Learn about Property Wrappers in Swift
Swift 5.1 introduced an interesting concept called Property Wrappers. As the name suggests, it creates a wrapper around any plain old properties in struct , class or enum and enhance their abilities. Let’s dive right into code. Almost every app out there saves some kind of information in UserDefaults. The common approach to do that would be: struct AppSettings { // Update the respective value in UserDefault static var isDarkModeEnabled = false { didSet { UserDefaults....