Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 12. Value of type 'AVCapturePhotoOutput' has no member 'supportedFlashModes'

Tags:

xcode

xcode12

In new Xcode 12, there is an error: Value of type 'AVCapturePhotoOutput' has no member 'supportedFlashModes' when i try to reach https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/1648766-supportedflashmodes Any suggestions?

like image 277
Nik Kov Avatar asked Sep 18 '20 09:09

Nik Kov


1 Answers

Seems to be a bug on Xcode 12, but you can workaround it using macro conditions:

#if !targetEnvironment(simulator)
guard stillImageOutput?.supportedFlashModes.contains(mode) == true else { return }
//rest of your code
#endif
like image 89
Bruno Guidolim Avatar answered Nov 12 '22 22:11

Bruno Guidolim