Tried a few of the combination responses without much success.
Using Swift 4, I found that I needed to make sure the following two items were implemented to ensure that the image was selected and placed into the picker (note that the "[discovery] errors encountered while discovering extensions:
>Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}"
message still displays in the console, but it does not prevent you from adding an image). Maybe this is a message that results in the picker being dismissed?
1) The delegate for the `UIImagePickerController` is `(UIImagePickerControllerDelegate & UINavigationControllerDelegate)?` so need to explicitly add the `UINavigationControllerDelegate` as one of the protocols:
class ViewController:UIViewController, UIImagePickerControllerDelegate,
UINavigationControllerDelegate { .... }.
2) Make sure that the info.plist has the `Privacy - Photo library Usage Description` key and String value set.
Of course, you need to ensure that you create a `UIImagePickerController` and set its delegate equal to `self` in `ViewDidLoad()`:
class ViewController:UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
let imagePickerController = UIImagePickerController()
override func viewDidLoad() {
super.viewDidLoad()
imagePickerController.delegate = self
}
...
}