这是我的代码:
PHImageManager.default().requestImageData(for: asset!, options: PHImageRequestOptions(), resultHandler: {
(imagedata, dataUTI, orientation, info) in
if PHImageResultIsInCloudKey == "true" {
print("Works!") // not executed
}
}
我不知道如何正确使用PHImageResultIsInCloudKey来检查它是返回true还是false。
我该怎么做?
答案 0 :(得分:0)
我还没有编译代码,但这应该有效:
PHImageManager.default().requestImageData(for: asset!, options: PHImageRequestOptions(), resultHandler: {
(imagedata, dataUTI, orientation, info) in
if let info = info as [String: Any], let isIniCloud = info[PHImageResultIsInCloudKey] as NSNumber, isIniCloud.boolValue == true {
print("Works!") // not executed
}
}