【发布时间】:2017-05-11 10:23:44
【问题描述】:
我使用QBImagePickerController 一次选择多个图像。
所以,这是我的全部代码
我正在向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 中?
我从中获得了文件名,但不值得从中设置图像。
我使用了 filePathURL、fileURL、absoluteURL 但什么也没发生,它崩溃了
所以请帮我解决一下
谢谢
【问题讨论】:
-
@Jecky 查看我的答案