MBViewControllerFactory

Objective-C


@interface MBViewControllerFactory : NSObject

Swift

class MBViewControllerFactory : NSObject

Factory class containing static methods for creating camera view controllers. Camera view controllers created this way will be managed internally by the SDK, and input frames will be processed.

Creating Scanning view controllers

  • Method creates a camera view controller which is responsible for displaying the camera input on the phone screen.

    With this method you can specify custom overlay view to be used on the camera display. The only requirement for the overlay view is that it’s a subclass of MBOverlayViewController

    Declaration

    Objective-C

    + (nullable UIViewController<MBRecognizerRunnerViewController> *)
        recognizerRunnerViewControllerWithOverlayViewController:
            (nonnull MBOverlayViewController *)overlayViewController;

    Swift

    class func recognizerRunnerViewController(withOverlayViewController overlayViewController: MBOverlayViewController) -> (UIViewController & MBRecognizerRunnerViewController)?

    Parameters

    overlayViewController

    View Controller which is presented on top of scanning view controller as a child.

    Return Value

    Scanning view controller fully initialized for presenting on screen.

  • The method creates a camera view controller, which is responsible for displaying the camera input on the phone screen. With this method, you can specify blocks for handling when scanning is finished and when scanning is canceled via the cancel button. When scanning is finished with a result, scanning is automatically paused.

    Declaration

    Objective-C

    + (nullable UIViewController<MBRecognizerRunnerViewController> *)
        recognizerRunnerViewControllerWithResult:
            (nonnull MBScanningResultBlock)result
                               closeButtonTapped:
                                   (nonnull MBScanningOverlayCloseButtonTappedBlock)
                                       closeButtonTapped;

    Swift

    class func recognizerRunnerViewController(withResult result: @escaping MBScanningResultBlock, closeButtonTapped: @escaping MBScanningOverlayCloseButtonTappedBlock) -> (UIViewController & MBRecognizerRunnerViewController)?

    Parameters

    result

    Closure which will be called when the scanning view controller is finished with scanning. Receives one parameter: BlinkIdMultiSideRecognizerResult

    closeButtonTapped

    Closure which will be called when cancel button is tapped

    Return Value

    Scanning view controller fully initialized for presenting on screen.