我正在使用这段代码将一个PHAsset
转换为全尺寸的UIImage
:
func getOriginalAsset(asset: PHAsset, onComplete: @escaping (UIImage?, [AnyHashable: Any]?) -> ()) {
let manager = PHImageManager.default()
let option = PHImageRequestOptions()
option.isNetworkAccessAllowed = true
manager.requestImage(for: asset, targetSize: PHImageManagerMaximumSize, contentMode: .aspectFit, options: option) { (image, info) in
onComplete(image, info)
}
}
然而,每次我尝试运行此代码时,控制台都会给出以下警告:
[ImageManager] First stage of an opportunistic image request returned a non-table format image, this is not fatal, but it is unexpected
问题
为什么我会收到这个警告?
如何解决这个问题?
更新
尽管有警告,但当我运行这段代码时一切都正常。我只是不能容忍我的应用程序中出现任何警告/错误(也许我迟早得学会接受它)。
onComplete
,因此这可能不是最佳架构。 - matt