24 lines
778 B
Swift
24 lines
778 B
Swift
import Foundation
|
|
import LocalData
|
|
import SharedKit
|
|
|
|
extension StorageKeys {
|
|
/// Stores user profile as JSON file in documents.
|
|
struct UserProfileFileKey: StorageKey {
|
|
typealias Value = UserProfile
|
|
|
|
let name = UserProfile.storageKeyName
|
|
let domain: StorageDomain
|
|
let security: SecurityPolicy = .none
|
|
let serializer: Serializer<UserProfile> = .json
|
|
let owner = "SampleApp"
|
|
let description = "Stores a lightweight user profile for file storage and watch sync."
|
|
let availability: PlatformAvailability = .phoneWithWatchSync
|
|
let syncPolicy: SyncPolicy = .automaticSmall
|
|
|
|
init(directory: FileDirectory = .documents) {
|
|
self.domain = .fileSystem(directory: directory)
|
|
}
|
|
}
|
|
}
|