IOS8: AVFoundation camera freeze

Possible duplicate: Custom camera view does not work on iOS 8 / Xcode 6

I use AVFoundation to capture still images. It worked fine until the arrival of iOS8 . On iOS8 , if my application goes into the background while the camera layer is still floating, and then after the application comes out in the foreground, the camera layer freezes and calling the image capture method does not work. Any help?

+6
source share
1 answer

try it...

In -viewWillAppear: start capturing the camera in the main thread like this.

 dispatch_async(dispatch_get_main_queue(), ^{ if (![session isRunning]) { [session startRunning]; } }); 
+2
source

Source: https://habr.com/ru/post/975818/


All Articles