我使用QBImagePickerController一次选择多个图像。可以从库的PHAsset获取图像
所以,这里是我的全部代码
我使用此代码呈现imagepickerController
let imagePickerController = QBImagePickerController()
imagePickerController.delegate = self
imagePickerController.allowsMultipleSelection = true
imagePickerController.mediaType = .Image
self.presentViewController(imagePickerController, animated:
true, completion: nil)
所以当我选择多张图像,然后点击完成,这种方法称为
func qb_imagePickerController(imagePickerController: QBImagePickerController!, didFinishPickingAssets assets: [AnyObject]!) {
for asset in assets {
print(asset.fileName)
}
self.dismissViewControllerAnimated(true, completion: nil)
}
对于例如,我选择一张图像,然后像这样打印。
<PHAsset: 0x7fc55d954500> 6006CE57-81FE-4DC0-8C52-5DB43CE7638D/L0/001 mediaType=1/0, sourceType=1, (1920x1080), creationDate=2016-05-26 09:15:34 +0000, location=0, hidden=0, favorite=0
从这我怎么可以得到图像,并将其设置为collectionview?
我从它得到fileName,但它不值得从它设置图像。
我用filePathURL,fileURL,absoluteURL但没有发生坠毁
所以,请帮我一下吧
谢谢
的可能的复制[虽然转换PHAsset到的UIImage失去透明度(http://stackoverflow.com/questions/38283416/while-converting-phasset-to-uiimage-losing - 透明度) –
@Jecky结帐我的答案 –