-3

I would like to know what are the best practices regarding, Modeling data when no network connection available, if the app you are building is cloud computing based, but still you want to be able to have basic functionality and I guess some persistent data?

PD: I am kind of new to IOS development

  • This is hard to answer without more information. Take a look at core data perhaps? – boidkan Jul 27 '17 at 15:51
  • Way too vague a question and asking for opinions. This site isn't meant for such a question. –  Jul 27 '17 at 15:52

2 Answers2

1

UserDefaults is okay for small bits of data that don't change often, but as it has to rewrite the entire user defaults dataset to a file each time a change it made, it is not robust enough for anything of volume or with frequent changes. For that you would want CoreData or a third party open source solution like Realm.io.

David Lari
  • 943
  • 11
  • 21
0

You can try to using the 'cache' where you store temporary data. One way to achieve this is NSUserDefaults where you set a variable (let's say users profile photo) and when the user opens his app again, the image will be loaded even if there is no internet connection since its cached. Hope this helps!

Mohamad Bachir Sidani
  • 2,077
  • 1
  • 11
  • 17