How do I use UserDefaults with SwiftUI?
The approach from caram is in general ok but there are so many problems with the code that SmushyTaco did not get it work. Below you will find an “Out of the Box” working solution. 1. UserDefaults propertyWrapper import Foundation import Combine @propertyWrapper struct UserDefault<T> { let key: String let defaultValue: T init(_ key: String, … Read more