Merge pull request #130 from kabanishe23/bugfix_120
Get ride of lazy init of previewLayer. Fixes #120
This commit is contained in:
commit
eaf911bc97
|
@ -75,9 +75,7 @@ public final class QRCodeReader: NSObject, AVCaptureMetadataOutputObjectsDelegat
|
||||||
// MARK: - Managing the Properties
|
// MARK: - Managing the Properties
|
||||||
|
|
||||||
/// CALayer that you use to display video as it is being captured by an input device.
|
/// CALayer that you use to display video as it is being captured by an input device.
|
||||||
public lazy var previewLayer: AVCaptureVideoPreviewLayer = {
|
public let previewLayer: AVCaptureVideoPreviewLayer
|
||||||
return AVCaptureVideoPreviewLayer(session: self.session)
|
|
||||||
}()
|
|
||||||
|
|
||||||
/// An array of object identifying the types of metadata objects to process.
|
/// An array of object identifying the types of metadata objects to process.
|
||||||
public let metadataObjectTypes: [AVMetadataObject.ObjectType]
|
public let metadataObjectTypes: [AVMetadataObject.ObjectType]
|
||||||
|
@ -128,7 +126,7 @@ public final class QRCodeReader: NSObject, AVCaptureMetadataOutputObjectsDelegat
|
||||||
*/
|
*/
|
||||||
public init(metadataObjectTypes types: [AVMetadataObject.ObjectType], captureDevicePosition: AVCaptureDevice.Position) {
|
public init(metadataObjectTypes types: [AVMetadataObject.ObjectType], captureDevicePosition: AVCaptureDevice.Position) {
|
||||||
metadataObjectTypes = types
|
metadataObjectTypes = types
|
||||||
|
previewLayer = AVCaptureVideoPreviewLayer(session: session)
|
||||||
super.init()
|
super.init()
|
||||||
|
|
||||||
sessionQueue.async {
|
sessionQueue.async {
|
||||||
|
|
Loading…
Reference in New Issue