Files
downterm/CommandNotch/CommandNotch/Views/SettingsBindings.swift
2026-03-13 21:26:06 +11:00

14 lines
351 B
Swift

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