Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AVCaptureSession startRunning exc_bad_access iOS 10 Swift 3

Tags:

ios

swift

I'm having an exc_bad_access crash when starting an AVCaptureSession:

        if captureSession.isRunning == false {
           captureSession.startRunning()
        }

Notice: It was working in Swift 2.2. I'm having this crash only after migration to Swift 3. Any idea!

like image 590
Harrath hichem Avatar asked Oct 23 '25 21:10

Harrath hichem


1 Answers

YES! zsteed's answer works

Add to your Info.plist:

<key>NSCameraUsageDescription</key>
<string>Allow us to scan documents and capture images.</string>
like image 117
karnett Avatar answered Oct 25 '25 11:10

karnett



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!