Rizwan Shaikh Rizwan Shaikh - 14 days ago 7
iOS Question

ELCImagePickerController does not back to viewController in swift

I use

ELCImagePickerController
to select multiple photos. However when i select photos and click Done button its goes back to select an album page. Please help me so when i select photos it should back to
viewController
.

Here is code i using:

var picker = ELCImagePickerController(imagePicker: ())
@IBAction func ButtonIsclick(sender: AnyObject) {
picker.delegate = self

self.presentViewController(picker, animated: true, completion: nil)
}

func elcImagePickerController(picker: ELCImagePickerController!, didFinishPickingMediaWithInfo info:[AnyObject]!) {
self.dismissViewControllerAnimated(true, completion: nil)
}

func elcImagePickerControllerDidCancel(picker: ELCImagePickerController!){
self.dismissViewControllerAnimated(true, completion: nil)
}


EDIT: When i debug the code its never call the
didFinishPickingMediaWithInfo
function

Answer

Actually i face this problem because of wrongly set the delegate.

In my question i set delegate as

picker.delegate = self

Which is wrong . Right way is to set ELCImagepickerDelegate is

 picker.imagePickerDelegate = self