I am using QBImagePickerController for selecting multiple images at a time.
So, here is my whole code
I am presenting imagepickerController
with this code
let imagePickerController = QBImagePickerController()
imagePickerController.delegate = self
imagePickerController.allowsMultipleSelection = true
imagePickerController.mediaType = .Image
self.presentViewController(imagePickerController, animated:
true, completion: nil)
so when I choose multiple images and click done, This method called
func qb_imagePickerController(imagePickerController: QBImagePickerController!, didFinishPickingAssets assets: [AnyObject]!) {
for asset in assets {
print(asset.fileName)
}
self.dismissViewControllerAnimated(true, completion: nil)
}
For example, I select one image then it prints like this
<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
From this how can I get image and set it into collectionview?
I get fileName from it but its not worthy to set image from it.
I use filePathURL, fileURL, absoluteURL but nothing happened it crashed
So please help me with it
Thank you
You need to use
requestImageForAsset
to getUIImage
. You can get image like this way