ELCImagePickerController

ELCImagePickerController

我使用ELCImagePickerController选择多张照片。但是,当我选择照片并单击“完成”按钮时,它会返回以选择相册页面。请帮助我,所以当我选择照片时,应该回到viewController

这是我使用的代码:

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)
}

编辑:当我调试代码时,它永远不会调用didFinishPickingMediaWithInfo函数

最佳答案

实际上,由于错误设置了delegate,我遇到了这个问题。

在我的问题中,我将delegate设置为

picker.delegate = self

这是错的。正确的方法是将ELCImagepickerDelegate设置为
 picker.imagePickerDelegate = self

10-08 05:25