25 lines
859 B
Swift
25 lines
859 B
Swift
import Foundation
|
|
import LocalData
|
|
|
|
extension StorageKeys {
|
|
/// Syncable setting with configurable platform and sync policy.
|
|
/// Grouped under Platform to highlight availability/sync behavior.
|
|
struct SyncableSettingKey: StorageKey {
|
|
typealias Value = String
|
|
|
|
let name = "syncable_setting"
|
|
let domain: StorageDomain = .userDefaults(suite: nil)
|
|
let security: SecurityPolicy = .none
|
|
let serializer: Serializer<String> = .json
|
|
let owner = "SampleApp"
|
|
let description = "Stores a setting that can be synced to watch."
|
|
let availability: PlatformAvailability
|
|
let syncPolicy: SyncPolicy
|
|
|
|
init(availability: PlatformAvailability = .all, syncPolicy: SyncPolicy = .never) {
|
|
self.availability = availability
|
|
self.syncPolicy = syncPolicy
|
|
}
|
|
}
|
|
}
|