Yep. AI rewrote the whole thing.
This commit is contained in:
13
Downterm/CommandNotch/Views/SettingsBindings.swift
Normal file
13
Downterm/CommandNotch/Views/SettingsBindings.swift
Normal file
@@ -0,0 +1,13 @@
|
||||
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 }
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user