UIViewController(SBSDK)

@interface UIViewController (SBSDK)

Extension of UIViewController to help with embedding child view controllers.

  • Embedds a view controller as child view controller. The child view controllers view is added to the container view, which must be an adjacent view of the receivers view.

    Declaration

    Objective-C

    - (void)sbsdk_attachViewController:(nonnull UIViewController *)viewController
                                inView:(nonnull UIView *)containerView;

    Swift

    func sbsdk_attach(_ viewController: UIViewController, in containerView: UIView)

    Parameters

    viewController

    The view controller that be embedded into the receiver.

    containerView

    The UIView that holds and layouts the embedded view controllers view.

  • Detaches a child view controller from the receiver and removes its view from the view hierarchy.

    Declaration

    Objective-C

    - (void)sbsdk_detachViewController:(nonnull UIViewController *)viewController;

    Swift

    func sbsdk_detach(_ viewController: UIViewController)

    Parameters

    viewController

    The child view controller that should be removed from the receivers child view controllers hierarchy.

  • Acquires video orientation for camera instance from interface orientation.

    Declaration

    Objective-C

    - (AVCaptureVideoOrientation)videoOrientationFromInterfaceOrientation;

    Swift

    func videoOrientationFromInterfaceOrientation() -> AVCaptureVideoOrientation