我使用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
关于ios - ELCImagePickerController 不会 swift 返回到 viewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30883871/