2 errors occur after migrating to swift 4.
First error:
Initializer for conditional binding must have Optional type, not AVCaptureVideoPreviewLayer.
Second error:
Initializer for conditional binding must have Optional type, not [AVCaptureDevice].
How Should I correct these errors?
Thanks
I think you just remove if let ...
condition and changes
like simple
let cameraLayer = AVCaptureVideoPreviewLayer(session: self.cameraSession)
And same for second error means you should use directly videoDevices
no need to use if let...
condition.