appcoda / FullScreenCamera

A Full Screen Camera App written in Swift
165 stars 50 forks source link

Crashes if you switch cameras and turn the flash on #2

Open wizard1066 opened 7 years ago

wizard1066 commented 7 years ago

Comment says it all. CRASHES if you use the selfie view with the flash on.

lukelucas247 commented 6 years ago

Inside: func captureImage(completion: @escaping (UIImage?, Error?) -> Void) {}

Change: settings.flashMode = self.flashMode

With:

if currentCameraPosition == .front {
                        settings.flashMode = AVCaptureDevice.FlashMode.off
                } else if currentCameraPosition == .rear {
                        settings.flashMode = self.flashMode
                }