Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wizard1066 opened this issue Aug 20, 2017 · 1 comment
Open

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

wizard1066 opened this issue Aug 20, 2017 · 1 comment

Comments

@wizard1066
Copy link

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

@lukelucas247
Copy link

lukelucas247 commented Feb 21, 2018

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
               }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants