Fix deadlock when loading assets after requesting authorization

This commit is contained in:
Shadowfacts 2022-03-29 12:07:57 -04:00
parent 12bcf52764
commit 705fbbe343
1 changed files with 3 additions and 1 deletions

View File

@ -143,8 +143,10 @@ class AssetCollectionViewController: UIViewController, UICollectionViewDelegate
switch PHPhotoLibrary.authorizationStatus(for: .readWrite) {
case .notDetermined:
PHPhotoLibrary.requestAuthorization(for: .readWrite) { (_) in
DispatchQueue.main.async {
self.loadAssets()
}
}
return
case .restricted, .denied: