好吧,你可以把答案和 comments 拼凑起来,但是试着讲一个更完整的故事...
在iOS 11中,UIImagePickerController
次运行是作为应用程序的一个单独进程进行的.这意味着:
- 你的应用程序无法看到用户的整个照片库——它只能对用户在图像 Select 器中 Select 的任何资源进行只读访问.
- 因为(1),你的应用不需要标准的隐私授权来访问照片库.用户明确 Select 在你的应用程序中使用的特定assets资源 (或多个),这意味着用户正在授予你的应用程序读取相关assets资源 的权限.
你可以看到更多关于这in the WWDC17 talk on PhotoKit的信息.
(顺便说一句,这款手机与iOS 9之后你看到的in the Contacts framework款手机相匹配;如果你显示联系人选取器,你的应用程序只会一次性删除用户选取的联系人的联系信息,而不需要对联系人数据库进行读/写访问,因此联系人选取器不需要特殊的隐私权限.)
PHPhotoLibrary
and its authorization status reflect the global read/write permission for Photos access that users can control from Settings > Privacy. (That's the one where your Info.plist needs NSPhotoLibraryUsageDescription
.) Any use of the PHPhotoLibrary
API requires this permission, regardless of whether your app's use of that API is only for writing or only for reading. This has been true since PhotoKit was introduced in iOS 8.
如果您没有使用PHPhotoLibrary
、PHAsset
等,iOS 11中新增了一些更窄的权限选项(不是Photos.framework API的一部分):