iOSManiac iOSManiac - 12 days ago 6
iOS Question

Storing images and files in iOS devices

I would like to know about storing the images or files of my application to the device. I think we can store these things to Document directory/library. I would like to know , is there any other options we have.

I have seen somewhere like, we can save the images to photo library with UIImageWriteToSavedPhotosAlbum.Could anyone please give me more information regarding this.If it is saved to photo library where is it being saved ?

Answer

You certainly can save to the local user directory for the app, though keep in mind that this is sandboxed by iOS so that each app has its own document directory.

It is possible to use AppGroups to have 2 or more apps that you control share a single space. But keep in mind this AppGroup has to be engineered into all apps that use it!

Here is Apple's doc on the iOS file system

Here is Apple's doc on writing App Extensions which actually uses AppGroups to allow an extension and and App to share space.

Finally, yes there is full support for you to write to the Photo Library. You'll want to use the Photos Framework and the images and videos are simply saved into the iOS "Photos" app. You can create a folder to hold your App's images, for instance.

Here is a link to Apple's Photos Framework.

If you have more specific questions, be sure to post those along with code you've tried and you'll get lots of help here!