图像选择器委托(delegate)未在 Xcode 7 中编译。它仍在 Xcode 6.4 中编译。
我有 Xcode 版本 7.0 beta 3 (7A152u)
在 Xcode 7 中有没有新的函数声明方式?这就是我在代码中使用它的方式:
class ViewController: UIViewController, UITableViewDataSource,
UITableViewDelegate, UIImagePickerControllerDelegate,
UINavigationControllerDelegate {
func imagePickerController(
picker: UIImagePickerController,
didFinishPickingMediaWithInfo info: [NSObject : AnyObject]) {
}
}
最佳答案
尝试:
func imagePickerController(
picker: UIImagePickerController,
didFinishPickingMediaWithInfo info: [String : AnyObject]) {
// code
}
关于swift - imagePickerController(_ :didFinishPickingMediaWithInfo:) Xcode 7 Swift Error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31564953/