import SwiftUI @MainActor extension AppSettingsController { func binding(_ keyPath: WritableKeyPath) -> Binding { Binding( get: { self.settings[keyPath: keyPath] }, set: { newValue in self.update { $0[keyPath: keyPath] = newValue } } ) } }