Inherits from UIView
Declared in SGSScanPreviewView.h

Tasks

Properties

previewLayer

预览图层,由 setPreviewLayer:rectOfInterest:style: 方法指定

@property (nullable, nonatomic, weak, readonly) AVCaptureVideoPreviewLayer *previewLayer

Declared In

SGSScanPreviewView.h

rectOfInterest

@property (nonatomic, assign) CGRect rectOfInterest
Discussion

通过 setter 方法可以重新设置四角控制标识和动画的位置, 因此在屏幕旋转之后可以重新设置识别区域刷新布局

Declared In

SGSScanPreviewView.h

Instance Methods

setPreviewLayer:rectOfInterest:style:

设置预览图层、识别区域以及样式

- (void)setPreviewLayer:(AVCaptureVideoPreviewLayer *)previewLayer rectOfInterest:(CGRect)rectOfInterest style:(SGSScanPreviewStyle *)style

Parameters

previewLayer

预览图层

rectOfInterest

扫描识别区域

style

预览视图样式

Declared In

SGSScanPreviewView.h

startAnimating

开启扫描动画

- (void)startAnimating

Declared In

SGSScanPreviewView.h

stopAnimating

停止扫描动画

- (void)stopAnimating

Declared In

SGSScanPreviewView.h