SwiftUI
SwiftUI: AppStorage with Dynamic Key
If we want to use @AppStorage but with a dynamic key passed to the View we can do this: DynamicKeyApp.swift ContentView.swift
If we want to use @AppStorage but with a dynamic key passed to the View we can do this: DynamicKeyApp.swift ContentView.swift
Here is one way to implement @AppStorage using a custom UserDefaults suite by way of the defaultAppStorage View modifier and a class extension. GroupDefaultsTestApp.swift ContentView.swift