I have an application that takes some snapshots. My entire application is based on the AVCam sample code from WWDC 2010. I have mixed up a lot with this, but still I canβt figure out how to format the camera correctly, which frees up the camera session ...
All I'm trying to do is the following:
- Open camera view controller
- Take some photos
- Close the camera controller.
- Open it again
The second time I click viewController, the session is lost, the preview is not available, and the capture is also not available. I posted a complete sample code on github .
My workaround for the problem was to not release the camera at all, so the camera view controller acts like Singleton, which, in my opinion, is not the right way. Moreover, with this behavior, I could not understand how to support the camera when the application moved to the background (for example, a phone call).
Please advice . How to destroy a camera session? and is it important to do this?
Eladg source
share