我正在删除一些照片资产,我想在资产被删除时显示一个活动指示器,并在资产被删除但我的代码运行缓慢时停止它,你知道出了什么问题吗?
PHPhotoLibrary.sharedPhotoLibrary().performChanges({
PHAssetChangeRequest.deleteAssets(enumeration)
self.activityIndicator.startAnimating()
UIApplication.sharedApplication().beginIgnoringInteractionEvents()
}, completionHandler: {success, error in
if success {
self.activityIndicator.stopAnimating()
UIApplication.sharedApplication().endIgnoringInteractionEvents()
println("Success")
} else {
self.activityIndicator.stopAnimating()
UIApplication.sharedApplication().endIgnoringInteractionEvents()
println("Error")
}
})