Create custom imagePicker with multiple image selection iOS swift
Solution:
You have to install the pod to your project.
Then open the podfile and add the line below
Then goto your viewcontroller and import the bsimagepicker like below
You have to install the pod to your project.
Then open the podfile and add the line below
    pod 'BSImagePicker', '~> 2.8'
Then goto your viewcontroller and import the bsimagepicker like below
import BSImagePicker
Then add the below set of codes to your button action to pick images from gallery
        let vc = BSImagePickerViewController()
        bs_presentImagePickerController(vc, animated: true,
                                        select: { (asset: PHAsset) -> Void in
                                            print("Selected: \(asset)")
        }, deselect: { (asset: PHAsset) -> Void in
            print("Deselected: \(asset)")
        }, cancel: { (assets: [PHAsset]) -> Void in
            print("Cancel: \(assets)")
        }, finish: { (assets: [PHAsset]) -> Void in
//here yocan get the images            
        }, completion: nil)
Comments
Post a Comment