How do I select multiple images for an image picker and then return as an image? (2-5)

Hey, so I'm trying to create a button that, when clicked, allows the user to select 2-5 pictures from their photo library and then select any photo to be selected in the uiimageview screen? I looked online and couldn't find anything related to how to do this quickly. Thanks to

+3


source to share


2 answers


    I worked out using this : https://github.com/zhangao0086/DKImagePickerController .


    Getting selected image thumbnail images: 

     let pickerController = DKImagePickerController()
            pickerController.sourceType = .Photo
            pickerController.didCancelled = { () in
                println("didCancelled")
            }

            pickerController.didSelectedAssets = { [unowned self] (assets: [DKAsset]) in
                println("didSelectedAssets")
                println(assets)

                for(var i = 0; i<(assets.count); i++){
                    print(assets[i].url)

    self.PickedArray .addObject(assets[i].thumbnailImage!)
     }
    self.performSegueWithIdentifier("SegueToPhotoLibraryView", sender: self)


Getting selected image urls :

assets[i].url instead of assets[i].thumbnailImage

Hope it helps!

      



+1


source


IOS does not currently provide an out-of-the-box image picker that allows you to select multiple images from a photo library. UIImagePickerController only allows one image to be selected.

But there are several image picker implementations that allow you to select multiple images. You can find a whole bunch at cocoacontrols.com as @ytbryan mentioned.



I do not currently know of a single multiple set of images implemented in Swift. If anyone finds it, please edit and post the link.

0


source







All Articles