AVCaptureSession fails when returning from background

家住魔仙堡 提交于 2019-12-05 08:03:07
Chris Heyes

Do not start the capture session on view load, instead start it on viewWillAppear and stop it on viewWillDissapear.

Seems like your view controller is cleaning up some memory when the app is in the background. Make sure you are initializing your capture session with this in mind.

Allocate your session lazily in a private property getter method rather than in your start method you will avoid memory leaks this way.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!