A long time ago I wrote about NSUserDefaults being a good way to store user preferences within an app. Small amounts of data can be stored such as the current theme as well as other preferences for the app. The data is persisted so that it can be accessed when the app reloads.
Typically you would want to store small amounts of data in there. For larger amounts of data you should look at other means of storage. Data types such as strings, bools, numbers, dates and so on can be stored.
When Swift launched, UserDefaults was became available and enhanced NSUserDefaults by adding slightly better type safety.
[Read more…]