hex/ios/HEXShared/AppleIntelligenceCleanupSettings.swift
Dax 74c26f5bf5
ios: optional Apple Intelligence transcript cleanup (experiment) (#1538)
* ios: add off-by-default Apple Intelligence transcript cleanup experiment

* ios: let nonisolated settings read the app group id

* ios: reject added negations and stop cancelled cleanup work
2026-11-08 08:07:11 -05:00

20 lines
680 B
Swift

import Foundation
/// The Apple Intelligence cleanup experiment's switch in the shared App Group.
nonisolated struct AppleIntelligenceCleanupSettings {
private enum Key {
static let cleanup = "experiments.appleIntelligenceCleanup"
}
private let defaults: UserDefaults?
init(defaults: UserDefaults? = UserDefaults(suiteName: KeyboardBridge.appGroup)) {
self.defaults = defaults
}
/// Experiment: one on-device pass fixes misheard words after dictation. Off by default.
var isEnabled: Bool {
get { defaults?.bool(forKey: Key.cleanup) ?? false }
nonmutating set { defaults?.set(newValue, forKey: Key.cleanup) }
}
}