UserDefaults1 use-case is preserving User Interface states, one of essential items on the list of every good Mac and iOS application.
UserDefaults is one of most powerful examples why I love writing programms for Apple hardware. It is easy to get started, performant, and got even simpler2 over time. Just two-three lines of code and you wrote something to permanent storage. Which you can read at any time, so efficient, adding your own caching code would even hurt performance3.
Having an alternate code path for “no value set” is also generally unnecessary, as you can provide a default value instead.
Thank you David, for this excellent guide.