0

On an iphone, if you hold down on an image while in safari, a diaglog pops up asking you if you want to save or copy the image. If saved, the image is downloaded straight to your camera roll. If I wanted the user to save images to my app as conveniently as they are saved to the camera roll from safari, how would I go about doing that?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
the beest
  • 463
  • 6
  • 26
  • @BhavinRamani i'm not that familiar with ios development, but it seems like my question addresses how to use safari to save an image to my app, and the question you proposed as a possible duplicate, proposes how save an image to your app using a uiview that the developer created. i didn't create the safari app, nor can i edit it, so i don't think that these two questions are duplicates – the beest May 14 '16 at 12:33
  • You can save images in your app's document directory. – Bhavin Ramani May 14 '16 at 12:36
  • @BhavinRamani that doesn't address my question at all – the beest May 14 '16 at 12:38
  • @BhavinRamani i changed my question slightly. thought it was obvious that i wanted to implement code that would make it convenient for the _user_ to save images, not myself as the developer. check out the question again and see if you still think it's a duplicate – the beest May 14 '16 at 12:42
  • Possible duplicate of [How can I save an image to the camera roll?](http://stackoverflow.com/questions/11131050/how-can-i-save-an-image-to-the-camera-roll) – Fahri Azimov May 14 '16 at 12:46
  • @FahriAzimov if you read my question, you'd know that it addresses something entirely different than what that question does – the beest May 14 '16 at 12:50
  • My bad, I misunderstood the question. – Fahri Azimov May 14 '16 at 12:56
  • You can check on the App Extension if that can help you out. – Arun Gupta May 14 '16 at 17:23

1 Answers1

1

You should be able to set up your app as being able to open image files of the desired types (.jpg, .png, etc) by adding the appropriate settings to your info.plist, and that should cause the system to add an "open in" item to the sharing dialog in Safari.

Duncan C
  • 128,072
  • 22
  • 173
  • 272
  • this is as convenient as it gets, huh. and will the "open in" item always be listed after all the other native ios items i.e. "copy," "find on page," and "add to home screen," or in the "more" item? or, will the user not always have to scroll to the right in order to get to the "open in" item? – the beest May 14 '16 at 13:20
  • I haven't used this much, and don't recall the fine details. – Duncan C May 14 '16 at 21:13