尝试从iCloud获取图像时出现奇怪的错误,我做错了什么还是苹果错误?
有趣的是,从2-3 次尝试有效,我不知道为什么
let options = PHImageRequestOptions()
options.deliveryMode = PHImageRequestOptionsDeliveryMode.highQualityFormat
options.isSynchronous = false
options.isNetworkAccessAllowed = true
options.progressHandler = { (progress, error, stop, info) in
if let error = error {
print(error.localizedDescription)
}
DispatchQueue.main.async {
let numFormatter = NumberFormatter()
numFormatter.maximumFractionDigits = 0
if let progressString = numFormatter.string(from: NSNumber(value: progress * 100)) {
print("Downloading from iCloud (progressString) %")
if progress >= 0.99 {
self.hideLoadingLabel()
}
}
}
print("progress: (progress)")
}
PHImageManager.default().requestImage(for: self.selectedAsset, targetSize: CGSize(width: 300, height: 300), contentMode: .aspectFill, options: options) {
image, info in
self.hideLoadingLabel()
guard let image = image else { return }
let vc = RSKImageCropViewController(image: image, cropMode: RSKImageCropMode.circle)
vc.delegate = self
DispatchQueue.main.async {
self.navigationController?.pushViewController(vc, animated: true)
}
}
}
这是
iCloud中的一个错误。注销iCloud并重新启动并重新登录,它将被修复。多年来,它一直是一个错误。
这是一个网络问题。对于现实生活中的用例:当我的数据计划达到极限或达到下一层时,我开始看到此错误。就我而言,我登录到我的数据提供商网站并同意我的计划中下一个付费层。
注意:这不是iCloud中的错误,因为它是我的服务提供谁在限制连接。另请注意,在某些国家/地区,法律要求数据提供商使用户协议超过特定价格点。