PHCachingImageManager.stopCachin
2018-06-04 本文已影响15人
Harry_Lee
- PHCachingImageManager.stopCachingImagesForAllAssets()方法在没有相册访问权限的情况下调用会发生crash
- 解决方案:
PHCachingImageManager.stopCachingImagesForAllAssets调用之前判断是否有相册访问权限
deinit {
if PHPhotoLibrary.authorizationStatus() != .authorized {
return
}
PHPhotoLibrary.shared().unregisterChangeObserver(self)
PHCachingImageManager.stopCachingImagesForAllAssets()
}