MBCOverlayContainerViewController

Objective-C

@protocol MBCOverlayContainerViewController <MBCRecognizerRunnerViewController>

Swift

protocol MBCOverlayContainerViewController : MBCRecognizerRunnerViewController

Overlay View Controller also needs to notify CameraViewController on certain events. Those are events specified by MBCOverlayViewControllerDelegate protocol.

  • Notification sent when Overlay View Controller wants to close camera, for example, by pressing Cancel button.

    Declaration

    Objective-C

    - (void)overlayViewControllerWillCloseCamera:
        (MBCOverlayViewController *)overlayViewController;

    Swift

    func overlayViewControllerWillCloseCamera(_ overlayViewController: MBCOverlayViewController!)
  • Overlay View Controller should ask it’s delegete if it’s necessary to display Torch (Light) button. Torch button is not necessary if the device doesn’t support torch mode (e.g. iPad devices).

    Declaration

    Objective-C

    - (BOOL)overlayViewControllerShouldDisplayTorch:
        (MBCOverlayViewController *)overlayViewController;

    Swift

    func overlayViewControllerShouldDisplayTorch(_ overlayViewController: MBCOverlayViewController!) -> Bool
  • Overlay View Controller must notify it’s delegete to set the torch mode to On or Off

    Returns YES if torch mode was set successfully, otherwise NO.

    Declaration

    Objective-C

    - (BOOL)overlayViewController:(MBCOverlayViewController *)overlayViewController
                     willSetTorch:(BOOL)isTorchOn;

    Swift

    func overlayViewController(_ overlayViewController: MBCOverlayViewController!, willSetTorch isTorchOn: Bool) -> Bool
  • If help mechanism is implemented using MBCScanDelegate’s scanningViewControllerWillPresentHelp method, Overlay view controller should ask it’s container whether it’s appropriate do display help button;

    Declaration

    Objective-C

    - (BOOL)shouldDisplayHelpButton;

    Swift

    func shouldDisplayHelpButton() -> Bool

    Return Value

    YES if help button should be displayed.

  • Check if status bar is hidden or showed

    Declaration

    Objective-C

    - (BOOL)isStatusBarPresented;

    Swift

    func isStatusBarPresented() -> Bool
  • Overlay View Controller can ask it’s delegete about the status of Torch

    Declaration

    Objective-C

    - (BOOL)isTorchOn;

    Swift

    func isTorchOn() -> Bool
  • Overlay View Controller can ask it’s owner whether camera was authorized

    Declaration

    Objective-C

    - (BOOL)isCameraAuthorized;

    Swift

    func isCameraAuthorized() -> Bool