1

I have used following line of code for picking an image from the Photo Library. Now I want to create a URL for those images, if it's possible.

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

    let image = info[UIImagePickerControllerOriginalImage] as! UIImage
    self.imageView.image = image

    picker.dismiss(animated: true) {
        // Completion block
    }
}

How to create a URL for an UIImage?

Mannopson
  • 2,634
  • 1
  • 16
  • 32

1 Answers1

1

Try using let url = info[UIImagePickerControllerMediaURL] as! URL

Coder-256
  • 5,212
  • 2
  • 23
  • 51