if UIImagePickerController.isSourceTypeAvailable(.photoLibrary) {
let imagePicker = UIImagePickerController()
imagePicker.sourceType = .photoLibrary
imagePicker.allowsEditing = true
self.present(imagePicker, animated: true, completion: { })
}
即使我在设置中将“照片”访问权限设为“从不”,使用上述代码仍然可以显示图片选择器并展示照片。在展示之前,我会检查PHPhotoLibrary.authorizationStatus()
,但我想知道这是否是预期行为?