Storing Custom Data Types in User Defaults

In the last episode we had a bit of an issue... I was trying to store an enum value in UserDefaults, thinking it would automatically use the backing rawValue to store and load the value. Unfortunately this doesn't work. In this episode we fix this issue and extend our solution to also accommodate other data types by leveraging Codable and a custom protocol.

This is a companion discussion topic for the original entry at https://nsscreencast.com/episodes/422-user-defaults-custom-types