Recent newbie to SwiftUI and was noticed the introduction of property wrapper @AppStorage in iOS 14.
Wondering about the difference between @AppStorage and CoreData
struct ContentView: View {
@AppStorage("isDarkMode")
private var isDarkMode: Bool = false
var body: some View {
VStack {
Text(isDarkMode ? "Dark" : "Light")
Toggle(isOn: $isDarkMode) {
Text("Switch Mode")
}.fixedSize()
}
}
}