Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOS8: AVFoundation Camera Freeze

Possible Duplicate: Custom Camera View Not Working on iOS 8/Xcode 6

I'm using AVFoundation to capture still images. It was working fine until iOS8 arrival. On IOS8 if my app goes to background while camera layer is still floating and then after app comes in foreground the camera layer freezes and calling capture image method does't work. Any help?

like image 215
Abid Hussain Avatar asked Sep 25 '14 07:09

Abid Hussain


1 Answers

try this...

In –viewWillAppear: start camera capture on main thread, like this..

dispatch_async(dispatch_get_main_queue(), ^{

    if (![session isRunning])
        {              
                [session startRunning];
        }
});
like image 144
hmdeep Avatar answered Sep 30 '22 15:09

hmdeep