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
  • Calculates the required video orientation from the given interface orientation.

    Declaration

    Objective-C

    - (AVCaptureVideoOrientation)videoOrientationFromInterfaceOrientation:
        (UIInterfaceOrientation)orientation;

    Swift

    func videoOrientation(from orientation: UIInterfaceOrientation) -> AVCaptureVideoOrientation

    Parameters

    orientation

    The interface orientation to calculate the video orientation from.

    Return Value

    The capture video orientation for the given user interface orientation.

  • Returns the current user interface orientation, extracted from the screen object.

    Declaration

    Objective-C

    - (UIInterfaceOrientation)interfaceOrientationFromScreen;

    Swift

    func interfaceOrientationFromScreen() -> UIInterfaceOrientation