UIImagePickerController in Swift 3

自作多情 提交于 2019-11-28 01:57:43
Lion

I think you need to add privacy - key for camara and photo library in your info.plist file as from xcode 8. for example,

 Key : Privacy - Media Library Usage Description
 Value : YES 

 Key : Privacy - Photo Library Usage Description
 Value : YES 

 Key : Privacy - Camara Usage Description
 Value : YES 

here value is string not Boolean.

so try this.

Check Apple documentation for more details!

Reference : this so post

Follow the error message from xCode, and add key/value to Info.plist of application.

For example, I got an error message from my developing app. It reminds me to add NSCameraUsageDescription to app's Info.plist.


The error message from xCode

This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.


And MORE

Add key/value pair to Localizable.strings, it will give i18n support. For example, I add a pair to Localizable.strings (English). It will give English description when ask user about camera permission.

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