Reputation: 469
I was wondering whether there are any other ways in swift to save data locally on device, which will be available also after app close without using NSUserDefaults
.
If there are, in which cases is that specific solution preferable?
I know this is kind of general, but I know just this one way to do saving locally and from my experience, there is always more than one way to do something(unless there isn't). Any answers would be greatly appreciated
Upvotes: 1
Views: 67
Reputation: 6237
Yes there are different ways to store data locally.
As you have mentioned one of them is NSUserDefaults
In addition to that you can also:
Here some nice post Core Data VS SQLite
Now for:
in which cases is that speciffic solution preferable
I would say that NSUserDefaults
is good when you need to store some small pieces of data, for example: Numbers, Booleans, Strings.
Upvotes: 1