0

I am working on an iOS app. Client side is written in Swift.

I want users to be able to store text and images in a local DB, and then transmit the DB records to a server.

I already implemented client-side data storage (but not for image files) using SQLite DB. I know that it is possible to store image files as BLOBs in SQLite, but is it wise to do so? What are your experiences? If SQLite is not the right DB for this use case, what would be better?

sion_corn
  • 3,043
  • 8
  • 39
  • 65

1 Answers1

3

This StackOverflow answer discusses why saving an image in a database isn't the greatest idea.

I think the current best practice for saving images on iOS would be to save the image to documents or the photo album, and save the file path to the image in the DB. UIKit has UIImageWriteToSavedPhotosAlbum() which will save the image for you.

Community
  • 1
  • 1
Tim Morrill
  • 107
  • 3
  • +1. Thanks for the advice. I'm going to leave this open a while longer in case someone else wants to weigh in. – sion_corn Mar 18 '15 at 15:13