I am using ImagePicker with SwiftUI by UIImagePickerController. It can select an Image. But I want to know the original image file name also. Is there any way to do this?
I already tried this using following codes:
…
if let url = info[UIImagePickerController.InfoKey.imageURL] as? URL {
imagePicker.fileName = url.lastPathComponent
imagePicker.fileType = url.pathExtension
}
…
But above code gives the temporary image file name.
Please help.
Thanks and regards.