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

#11
use this code

func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any])
Reply

#12
**XCODE 10.1 / SWIFT 4.2 :**

1. Add required permissions (others mentioned)

2. Implement this delegate func:



func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {

if let pickedImage = info[UIImagePickerController.InfoKey.originalImage] as? UIImage {
self.imgView.contentMode = .scaleAspectFit
self.imgView.image = pickedImage
}

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

#13
I fixed this issue, call function below into viewdidload or viewWillAppear or viewDidAppear to check permission for your app.

func checkPermission() {
let photoAuthorizationStatus = PHPhotoLibrary.authorizationStatus()
switch photoAuthorizationStatus {
case .authorized:
print("Access is granted by user")
case .notDetermined:
PHPhotoLibrary.requestAuthorization({
(newStatus) in
print("status is \(newStatus)")
if newStatus == PHAuthorizationStatus.authorized {
/* do stuff here */
print("success")
}
})
print("It is not determined until now")
case .restricted:
// same same
print("User do not have access to photo album.")
case .denied:
// same same
print("User has denied the permission.")
}
}


And to use the above method, do not forget to add `import Photos` at top of the class.
Reply

#14
I got the same message when I was trying to present another controller from the picker callback `imagePickerController`. The solution which worked for me was to move my code inside the completion callback from the the picker dismiss method

func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
picker.dismiss(animated: true) {
if let pickedImage = info[UIImagePickerControllerOriginalImage] as? UIImage {
let cropController:CropViewController = CropViewController(croppingStyle: .circular, image: pickedImage)
cropController.delegate = self
self.present(cropController, animated: true, completion: nil)
}
}
}
Reply

#15
The solution that worked for me was simply going into Product (at the top of the screen) -> Scheme -> EditScheme -> Arguments

In Environment Variables, add OS_ACTIVITY_MODE with a value of "disable"

Hopefully this works for someone else!

I'll attach a screenshot just in case my description seemed confusing[![enter image description here][1]][1]


[1]:
Reply

#16
In my case I was getting this error because I was presenting an image picker controller without first verifying if the user had allowed access to images. Elsewhere in my code the user had granted permission so I think all I needed to do was import Photos. However, since they 'may' not have granted permission at that point in the app adding this just before I presented the image picker controller solved the issue for me (import Photos as well).

// request photos permission if permission has not been granted
if PHPhotoLibrary.authorizationStatus() != PHAuthorizationStatus.authorized {
PHPhotoLibrary.requestAuthorization({ (status: PHAuthorizationStatus) in

})
}

If this answer seems redundant my apologies but I had to piece together from a few different answer to get my solution working. Perhaps this will help someone else using Swift 4.
Reply

#17
On my end `UINavigationControllerDelegate` delegate is missing.

`class YourViewController:UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate`
Reply

#18
This had me stumped, but the answer at the link below worked for me. Error is gone and image displays as expected

Like one of the answers above, you have to have `(_ picker...` but also `@objc` before the function.

@objc func imagePickerController(_ picker: UIImagePickerController, didFinishPickingImage image: UIImage!, editingInfo: [NSObject : AnyObject]!) {
...
}

[To see links please register here]

Reply

#19
Make sure you are subclassing both: `UIImagePickerControllerDelegate, UINavigationControllerDelegate`.

Also, remember to set the delegate:

let picker = UIImagePickerController()
picker.allowsEditing = true
picker.sourceType = .photoLibrary
picker.delegate = self //Don't forget this line!
self.present(picker, animated: true, completion: nil)

Credits to [this source](

[To see links please register here]

).
Reply

#20
This is what I did and it solved my issue.

- add @objc
- add internal
- add _ before imagePicker
- make sure you are using Any and not AnyObject

Hope this helps!
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

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