Home » IOS » IOS Get image name in Image Picker ViewConroller

IOS Get image name in Image Picker ViewConroller

xcode closeup

Get the name of the chosen image from library using the following code in using Image Picker ViewController

Here imageName variable will contains the name of the file chosen.

About the author


Hi, i am Vipin, a programmer working in Dubai, UAE. I love blogging, and so started TechRounder for sharing my findings and other digital informations with others too. Please feel free to share your feedback with me in the comment section below or you can email me at vipin@techrounder.com.

1 Comment

Click here to post a comment

Your email address will not be published. Required fields are marked *

  • Thanks Vipin,
    This solution helps me in swift. I have used the same concept in swift to get the filename.
    In Swift it works like:-
    func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) {

    let gotImage = info[UIImagePickerControllerOriginalImage] as! UIImage
    let imagePath: NSURL = (info[UIImagePickerControllerReferenceURL] as! NSURL)
    let imageName: String = imagePath.lastPathComponent!
    self.dismissViewControllerAnimated(true, completion: nil)

Get latest updates
in your inbox

Subscribe to TechRounder mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.