我得到了以下访问 PHAsset 的代码。我需要从中传递一个 CGImage :
let imageManager = PHImageManager.defaultManager()
imageManager.requestImageDataForAsset(self.asset!, options: nil, resultHandler:{
(data, responseString, imageOriet, info) -> Void in
let imageData: NSData = data!
if let imageSource = CGImageSourceCreateWithData(imageData, nil) {
let imageProperties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, nil)! as NSDictionary
//How do I create a CGImage now?
}
})
我需要从中提取一个 CGImage 。去那里有困难...