Fix deadlock when loading assets after requesting authorization
This commit is contained in:
parent
12bcf52764
commit
705fbbe343
|
@ -143,8 +143,10 @@ class AssetCollectionViewController: UIViewController, UICollectionViewDelegate
|
||||||
switch PHPhotoLibrary.authorizationStatus(for: .readWrite) {
|
switch PHPhotoLibrary.authorizationStatus(for: .readWrite) {
|
||||||
case .notDetermined:
|
case .notDetermined:
|
||||||
PHPhotoLibrary.requestAuthorization(for: .readWrite) { (_) in
|
PHPhotoLibrary.requestAuthorization(for: .readWrite) { (_) in
|
||||||
|
DispatchQueue.main.async {
|
||||||
self.loadAssets()
|
self.loadAssets()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
|
|
||||||
case .restricted, .denied:
|
case .restricted, .denied:
|
||||||
|
|
Loading…
Reference in New Issue