【问题标题】:Photos framework照片框架
【发布时间】:2017-11-05 14:12:52
【问题描述】:

这是我的代码:

PHImageManager.default().requestImageData(for: asset!, options: PHImageRequestOptions(), resultHandler: {
    (imagedata, dataUTI, orientation, info) in

     if PHImageResultIsInCloudKey == "true" {
          print("Works!") // not executed
}
}

我不知道如何正确使用PHImageResultIsInCloudKey来检查它是返回真还是假。

我该怎么做?

【问题讨论】:

    标签: ios swift photosframework


    【解决方案1】:

    我还没有编译代码,但这应该可以工作:

    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
     }
    }
    

    【讨论】:

      猜你喜欢
      • 2017-08-24
      • 1970-01-01
      • 1970-01-01
      • 2014-08-19
      • 1970-01-01
      • 2014-11-28
      • 1970-01-01
      • 2015-10-20
      • 2016-02-06
      相关资源
      最近更新 更多