0

I just built my first app for iOS (a simple game) and I am saving and retrieving some basic settings like this:

let savingDefaults = UserDefaults.standard
let indexSaved = savingDefaults.integer(forKey: "storageColorScheme")

I'm thinking about my next project, in which I will need to store more information. At what point do you need to consider using a database? How much information can you realistically save and retrieve using UserDefaults?

jwhite318
  • 23
  • 3

1 Answers1

-1

For core data usage you need to think on relations, does my data needs to be hierarchically organised?

Can I manage my users data locally and thereafter sync with a backend service?

In cases like these you'll need a database because a bunch of variables are not manageable.

Anything beyond simple arrays or local vars are required for database instances and I recommend you reading about migration because if user A updates for version 1.0 but the version 1.1 has a newer database version with more objects and relations, the new users will end up with a crashing application.

Its not regarding size of data but how hard can be maintain it in long term.

https://developer.apple.com/documentation/coredata

JBarros35
  • 976
  • 1
  • 12
  • 18