I'm trying to find out how to get the asset URL of an image saved to the camera roll, but I can't find much that can help me out. I've seen Objective-C examples, but I'm not experienced with it and a lot of the times they use ALAssetLibrary, which is deprecated now. All I'm doing is saving a photo, but I need to get the URL to load it into another image whose UIImageView isn't always in existence. Trying to load it to the view crashes the app.
Code:
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String: AnyObject]) {
imagePicker.dismissViewControllerAnimated(true, completion: nil)
imageView.image = info[UIImagePickerControllerOriginalImage] as? UIImage
UIImageWriteToSavedPhotosAlbum((info[UIImagePickerControllerOriginalImage] as? UIImage)!, nil, nil, nil)
if let detail = self.detailItem {
print(info.values)
// ### Where I need to have the image URL ###
//detail.thumbnail = info[UIImagePickerControllerReferenceURL] as! String
}
}