- PHCachingImageManager.stopCachingImagesForAllAssets()方法在没有相册访问权限的情况下调用会发生crash
- 解决方案:
PHCachingImageManager.stopCachingImagesForAllAssets调用之前判断是否有相册访问权限
deinit {
if PHPhotoLibrary.authorizationStatus() != .authorized {
return
}
PHPhotoLibrary.shared().unregisterChangeObserver(self)
PHCachingImageManager.stopCachingImagesForAllAssets()
}
网友评论