Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 630 Vote(s) - 3.48 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PhotoPicker discovery error: Error Domain=PlugInKit Code=13

#31
I read the all these answers and little bit modified here and not needed to dismiss, this worked for me, Thanks others who have replied here.


@objc func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {

print("########### media picked")
picker.dismiss(animated: true, completion: nil)
let img = (info[UIImagePickerControllerOriginalImage] as? UIImage)!
//set img -picked image to "profileImage" UIimageView
//use image here
self.profileImage.image = img
}
}
Reply

#32
The Error also happens when you **have not configured the permissions of the usage of the Photo Library** in you `Info.plist` file.

You need to add `Privacy - Photo Library Usage Description` in the `Info.plist` with a *String* that will appear when your App tries the first time to access the Photo Library of the User.

The final `Info.plist` adjustments should look something like this:
[![enter image description here][1]][1]


[1]:
Reply

#33
I found it! It is trying to tell you that you do not have authorization to "photos" You need to include the `#import <Photos/Photos.h>` and request authorization for example like this in Objective-C.

Hope this will save you some time. I spent two full days debugging this!

[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
switch (status) {
case PHAuthorizationStatusAuthorized:
NSLog(@"PHAuthorizationStatusAuthorized");
break;
case PHAuthorizationStatusDenied:
NSLog(@"PHAuthorizationStatusDenied");
break;
case PHAuthorizationStatusNotDetermined:
NSLog(@"PHAuthorizationStatusNotDetermined");
break;
case PHAuthorizationStatusRestricted:
NSLog(@"PHAuthorizationStatusRestricted");
break;
}
}];

I am sure someone can tell you how to do the same in Swift.
Reply

#34
I came across the same problem. None of the above mentioned suggestions worked for me. However, I resolved it, by explicilty calling the picker.dismiss and dismiss post that. I am not clear why I have make dismiss calls like that, but it worked for me.


@objc func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {

print("Image picked")
picker.dismiss(animated: true, completion: nil)
dismiss(animated: true) {
print("dismissed")
self.delegate?.presentEditor(img: (info[UIImagePickerControllerOriginalImage] as? UIImage)!, id: self.id!)
}

}
Reply

#35
Make sure to add `internal func` at the beginning and then add the lower case after the parenthesis (`_ picker: UIImagePickerController…` and then change from `AnyObject` to `Any`]…
Check code below:

internal func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
if let pickedImage = info[UIImagePickerControllerOriginalImage] as? UIImage {

userPhoto.image = pickedImage

}

self.dismiss(animated: true, completion: nil)
}
Reply

#36
You need to make explicit Objective-C reference: `@objc`

@objc func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
let chosenImage = info[UIImagePickerControllerOriginalImage] as! UIImage
image = chosenImage
self.performSegue(withIdentifier: "ShowEditView", sender: self)
dismiss(animated: true, completion: nil)
}
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through