I\'m attempting to grab the file path of an image selected through an imagePickerController in order to upload the file to Firebase Storage.
func imagePicker
I had trouble getting the info[UIImagePickerControllerOriginalImage]
to work. I had to do it like this:
let assets = PHAsset.fetchAssetsWithALAssetURLs([localUrl], options: nil)
let asset = assets.firstObject
asset?.requestContentEditingInputWithOptions(nil, completionHandler: { (contentEditingInput, info) in
let imageFile = contentEditingInput?.fullSizeImageURL
// now call putFile with imageFile instead of localURL