Cant figure this one out. Everything works fine when the app is active, and than sometimes when i move the app to the background(pressing the home button) a
Just a quick update In 2017 if someone suffering overthinking such that thing,
Do the same thing but change your
stillImageOutput!.outputSettings = [AVVideoCodecKey: AVVideoCodecJPEG]
replace it with
stillImageOutput!.outputSettings = [((kCVPixelBufferPixelFormatTypeKey as NSString) as String):NSNumber(value:kCVPixelFormatType_32BGRA)]
it will solve the issue. If not, then come back here and write down :))