Swift types with @AppStorage and @SceneStorage

Introduced this year, AppStorage is a SwiftUI property wrapper that reflects a value from UserDefaults which allows for easy storage and observation of app data. Similarly, SceneStorage is a property wrapper that reads and writes to persisted, per-scene storage. They are both super useful, but as they are backed by plists, they are limited in the types of data they support. In this post, Federico Zanetello shows us how we can extend the Published SwiftUI property wrapper to provide similar storage functionality for Codable types.