【发布时间】:2020-12-01 19:32:23
【问题描述】:
let accessLevel : PHAccessLevel = .readWrite
let phStatus = PHPhotoLibrary.authorizationStatus(for: accessLevel)
if (phStatus == .notDetermined) {
PHPhotoLibrary.requestAuthorization(for: accessLevel) {
newStatus in
if (newStatus == .limited) {
var conf = PHPickerConfiguration()
conf.selectionLimit = 1
conf.filter = .any(of: [.images, .livePhotos])
let picker = PHPickerViewController(configuration: conf)
picker.delegate = self
self.present(picker, animated: true)
}
}
}
我使用上面的代码来测试 iOS 14 的新功能 Limited Photos Library。 在我使用新的 Api authorizationStatus 和 requestAuthorization 的代码中, 并成功获得 .limited 状态。但是尽管 .limited 状态,iOS 14 仍然显示所有 图书馆的照片。谁能帮我解决这个问题?
【问题讨论】: