Reputation: 2684
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
?
Upvotes: 1
Views: 672
Reputation: 5618
Try using let url = info[UIImagePickerControllerMediaURL] as! URL
Upvotes: 1