Search code examples
iosavfoundationavcapturesession

Autofocus not working in camera app sample code from Apple (AVFoundation AVCaptureSession)


I've noticed that the Camera App sample code provided by Apple crashes when taking a photo due to to memory leak...

No other information is provided by the unfriendly XCode debugger, but I've noticed that it is possible to successfully take a photo provided that Live Photo and True Depth and Portrait Mode are turned OFF.

Other (more major!) issue is that the autofocus does not work at all!

Has anyone been able to find a solution to this?

I am amazed how it is possible for such a bloated, inefficient, buggy and untested code to be released by a trillion dollar company..


Solution

  • Contacted Apple technical support. Confirmed it’s a bug. Bug report filed. Let’s hope they will fix it asap. If you face the same issue report it too.