Reputation: 936
I'm trying to do a picker controller for the camera/photo library. The correct option come up but I can't get the details back from the picker.
I have it declared as
class Add: UITableViewController, UIImagePickerControllerDelegate {
var imagePickerController : UIImagePickerController!
and in my view did load
override func viewDidLoad() {
imagePickerController = UIImagePickerController()
imagePickerController.delegate = self
}
I'm getting an when trying to set the delegate
Value of type '(UIImagePickerController, [UIImagePickerController.InfoKey : Any]) -> ()' has no member 'delegate'
If I comment out the delegate line, the code compiles but function afterwards doesn't run
@objc func imagePickerController(_ picker: UIImagePickerController,
didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
// Code
}
Upvotes: 0
Views: 182
Reputation: 16341
Add UINavigationControllerDelegate
conformance to your Add
ViewController:
class Add: UITableViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
Upvotes: 1