PreviewView

Objective-C

@interface PreviewView

Swift

class PreviewView

A subclass of UIView to represent the camera preview and extendes from UIView Which hold the preview layer to customize and view the camera frames

  • A Core Animation layer that displays the video as it’s captured.

    Declaration

    Objective-C

    @property (nonatomic, readonly) AVCaptureVideoPreviewLayer *previewLayer;

    Swift

    var previewLayer: AVCaptureVideoPreviewLayer! { get }
  • To add additional setup for preview view

    Declaration

    Objective-C

    - (void)extraSetup;

    Swift

    func extraSetup()
  • To reset the status of the PreviewView

    Declaration

    Objective-C

    - (void)reset;

    Swift

    func reset()
  • To notify when the scan engine states changes

    Declaration

    Objective-C

    - (void)scanEngine:(ScanEngine *)scanEngine
        didChangeStageFrom:(PreviewViewStates)from
                        to:(PreviewViewStates)to
                 extraInfo:(NSDictionary *)extra;

    Swift

    func scanEngine(_ scanEngine: ScanEngine!, didChangeStageFrom from: PreviewViewStates, to: PreviewViewStates, extraInfo extra: [AnyHashable : Any]!)

    Parameters

    scanEngine

    current ScanEngine class

    from

    PreviewViewState before the change

    to

    PreviewViewState after the change

    extra

    a dictionary with additional details