Similar to
PhotoPicker discovery error: Error Domain=PlugInKit Code=13
and also to
https://forums.developer.apple.com/thread/82105
BUT I have tried all of these suggestions and still get an error in the debug log. Running Swift 4 XCode 9A235
What was suggest at the various places was ...
- some people said add @objc
- some people said add internal
- some people suggested adding _ and making sure using Any and not AnyObject
- some people said to use didFinishPickingImageWithInfo (this returns no image for me)
- some people said dismsss the picker, others said dismiss self, others said dismiss both
- some said add the 'Privacy... ' to plist (done)
- added import Photos
- added prior call to force PHPhotoLibrary.requestAuthorization() { (status) -> Void in ...
I DID NOT get this issues in Swift 3 - previous xcode. But with Swift 4, I tried everying I saw suggested and I still get the following error
[discovery] errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}
The picker works fine and I DO end up selecting an image from photos, but I get this error message on picker exit (cancel or select), every time...
Any suggestions how to stop the error message? Other than the list of things offered at the other two links (summarized above)
my method
@objc internal func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
imageSelected = nil
if let editedImage = info["UIImagePickerControllerEditedImage"] as? UIImage {
imageSelected = editedImage
} else if let originalImage = info["UIImagePickerControllerOriginalImage"] as? UIImage {
imageSelected = originalImage
}
if imageSelected != nil {
handleSelectedImage() // override in subclass to do something with the returned image
}
picker.dismiss(animated: true, completion: nil) // mess of calling both dismiss to see if it helps - it does not
dismiss(animated: true, completion: nil)
}