/** Start scan - parameter supView: An incoming parent view. - parameter scanConfig: HandyScannerConfig (Default: HandyScannerConfig()). - parameter scanRegion: Valid scanning area. The default size is the same as that of the parent view. - parameter scanType: The supported recognizable scanning types are the same as the system API by default. - parameter scanHandler: Scan result callback */@available(iOS 10.0,*)publicfunc start(supView:UIView, scanConfig:HandyScannerConfig=HandyScannerConfig(), scanRegion:CGRect=.zero, scanType:[AVMetadataObject.ObjectType]=[], scanHandler:((HandyScannerResult)->Void)?=nil)
- 代理方法
/** Optional - parameter bottomView: A view from the bottom of the scan box to the bottom area of the parent view */@available(iOS 10.0,*)optionalfunc scannerLimit(_ bottomView:UIView)/** Optional - parameter fullView: A view that is the same size as the parent view */
@available(iOS 10.0,*)
optional func scannerUnrestrained(_ fullView:UIView)/** Optional - parameter brightnessValue: A brightness value */
@objc @available(iOS 10.0,*)
optional func scannerCaptureOutput(_ brightnessValue:Double)/** Optional - parameter values: scan result 'stringValue' array - parameter types: scan result 'objectType' array */
@available(iOS 10.0,*)
optional func scannerMetadataOutput(of values:Array<String>, by types:Array<AVMetadataObject.ObjectType>)
- 闪光灯
/** flash switch - parameter open: A Boolean value. The default is false */publicfunc torchFlash(open:Bool)
- 识别照片内容api(默认用于识别照片二维码)
/** Identify the content information in the picture (for details, please refer to the relevant API of the system cidetector, where the QR code content is identified by default) - parameter image: A valid picture. - parameter ofType: The type is used to specify the detection intent. (Default: CIDetectorTypeQRCode) - parameter context: The context argument specifies the CIContext to be used to operate on the image. May be nil. (Default: nil) - parameter options: The options parameter lets you optinally specify a accuracy / performance tradeoff. Can be nil or an empty dictionary. (Default: [[CIDetectorAccuracy: CIDetectorAccuracyHigh]]). - returns: Returns an array of CIFeature instances in the given image. */publicfunc detector(image:UIImage, ofType:String= CIDetectorTypeQRCode, context:CIContext?=nil, options:[String:Any]?=[CIDetectorAccuracy: CIDetectorAccuracyHigh])->Array<CIFeature>?