我试图覆盖UIImagePickerControllerDelegate中的imagePickerController函数。但是,我似乎得到了一个错误:
Ambiguous reference to member 'subscript'
我已经完成了多次谷歌搜索,这似乎对其他人一切正常?
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]){
myImageView.image = info[UIImagePickerControllerOriginalImage] as? UIImage
self.dismiss(animated: true, completion: nil)
}
非常感谢任何帮助。谢谢
答案 0 :(得分:8)
您的委托方法签名错误。它应该是:
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any])