0

I am using either the camera or the library app to take/select an image

eg.

func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) {

    // User has selected an image

    // To dismiss the image picker
    self.dismissViewControllerAnimated(true, completion: nil)

    // Select the Image of interest
    // retrieve the object via key from documentation
    self.imageView.image = info[UIImagePickerControllerOriginalImage] as? UIImage

}

If I set a breakpoint at self.imageView.image and step down, I can get the image properties but I don't know how to get the filename.

Fabio Berger
  • 1,921
  • 2
  • 24
  • 29
Dazzle
  • 2,880
  • 3
  • 25
  • 52
  • 1
    maybe [this question](http://stackoverflow.com/questions/9784887/getting-image-name-of-iphone-photo-library) can help? – Tj3n Jan 26 '16 at 09:25
  • Code I'm finding is out of date unfortunately – Dazzle Jan 26 '16 at 09:41
  • what do you mean with is out of date???? – oiledCode Jan 26 '16 at 10:09
  • @Dazzle have you tried the `AssetsLibrary` approach? – MatanGold Jan 26 '16 at 10:12
  • Sorry I am a noob, I know what I want to do but I am having trouble implementing code I am finding if someone could help that would be appreciated – Dazzle Jan 26 '16 at 10:13
  • @Dazzle It's not clear what you want to do. Why do you need the path, what do you want to do with it? Did you saved the image already? Do you want to save it? I'll be happy to help you with the code but need to understand the above. – MatanGold Jan 26 '16 at 10:15
  • Agree with @Dazzle - the code you have shown doesn't save the image anywhere, so there is no filename at this stage. I think the answer you need is here http://stackoverflow.com/questions/30887987/saving-a-photo-and-using-it-immidietly – Russell Jan 26 '16 at 10:27
  • I want the user to be able to select an image from their library and save the filename eg "JPG_001.jpg", and also to take a picture and save the filename but I think one will explain the other – Dazzle Jan 26 '16 at 10:30
  • @Dazzle the name of the image, that was saved to the camera roll, can't be modified. If you like to have control over the images file names you should save the images to your app folder. – MatanGold Jan 26 '16 at 10:47
  • I'm not looking to modify it, just save it / view it – Dazzle Jan 26 '16 at 10:48
  • @Dazzle you wrote that you want to change the filename. – MatanGold Jan 26 '16 at 10:52
  • The title says return the filename. The comments say I don't know how to get the filename. Any tips on how I can read the filename? – Dazzle Jan 26 '16 at 14:48

0 Answers0