MBOverlayContainerViewController

@protocol MBOverlayContainerViewController <MBRecognizerRunnerViewController>

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

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

    Declaration

    Objective-C

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

    Swift

    func overlayViewControllerWillCloseCamera(_ overlayViewController: MBOverlayViewController!)
  • 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:
        (MBOverlayViewController *)overlayViewController;

    Swift

    func overlayViewControllerShouldDisplayTorch(_ overlayViewController: MBOverlayViewController!) -> 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:(MBOverlayViewController *)overlayViewController
                     willSetTorch:(BOOL)isTorchOn;

    Swift

    func overlayViewController(_ overlayViewController: MBOverlayViewController!, willSetTorch isTorchOn: Bool) -> Bool
  • If help mechanism is implemented using PPScanDelegate’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