Since updating my devices to iOS 12.4 (and iOS 13 beta), I have noticed that my app crashes when attempting to set focus modes. I was previously able to do this while configuring my AVCaptureSession with the following code;
self.videoDeviceInput.device.focusMode = .continuousAutoFocus
When attempting to build my app on iOS 12.4 or iOS 13, my app crashes with the following error;
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AVCaptureDevice setFocusMode:] Unsupported focusMode - use -isFocusModeSupported: to discover valid focus modes'
In an attempt to rectify this, I added the following code;
if self.videoDeviceInput.device.isFocusModeSupported(.continuousAutoFocus) {
self.videoDeviceInput.device.focusMode = .continuousAutoFocus
}
However, it does not appear that this is ever called. Per the documentation for AVCaptureDevice focus modes, I do not see any reason why my capture devices (I've tried this on multiple devices) would suddenly not support the .continuousAutoFocus modes.
Has there been a change to AVFoundation that would indicate this change?