Update SecureStorgageSample
This commit is contained in:
parent
93eaaa353a
commit
3bfc92cd83
@ -82,7 +82,7 @@ The app demonstrates various storage configurations:
|
|||||||
|
|
||||||
### UserDefaults
|
### UserDefaults
|
||||||
- Simple string storage with automatic sync
|
- Simple string storage with automatic sync
|
||||||
- Custom suite support
|
- App Group UserDefaults support for shared preferences
|
||||||
|
|
||||||
### Keychain
|
### Keychain
|
||||||
- 7 accessibility options (whenUnlocked, afterFirstUnlock, etc.)
|
- 7 accessibility options (whenUnlocked, afterFirstUnlock, etc.)
|
||||||
|
|||||||
@ -2,19 +2,19 @@ import Foundation
|
|||||||
import LocalData
|
import LocalData
|
||||||
|
|
||||||
extension StorageKeys {
|
extension StorageKeys {
|
||||||
/// Stores user preferences in a custom suite.
|
/// Stores user preferences in App Group UserDefaults.
|
||||||
/// - Domain: UserDefaults (custom suite)
|
/// - Domain: App Group UserDefaults
|
||||||
/// - Security: None
|
/// - Security: None
|
||||||
/// - Sync: Never
|
/// - Sync: Never
|
||||||
struct UserPreferencesKey: StorageKey {
|
struct UserPreferencesKey: StorageKey {
|
||||||
typealias Value = [String: AnyCodable]
|
typealias Value = [String: AnyCodable]
|
||||||
|
|
||||||
let name = "user_preferences"
|
let name = "user_preferences"
|
||||||
let domain: StorageDomain = .userDefaults(suite: "group.com.example.securestorage")
|
let domain: StorageDomain = .appGroupUserDefaults(identifier: AppGroupConfiguration.identifier)
|
||||||
let security: SecurityPolicy = .none
|
let security: SecurityPolicy = .none
|
||||||
let serializer: Serializer<[String: AnyCodable]> = .json
|
let serializer: Serializer<[String: AnyCodable]> = .json
|
||||||
let owner = "SampleApp"
|
let owner = "SampleApp"
|
||||||
let description = "Stores user preferences for app configuration screens."
|
let description = "Stores shared user preferences for app configuration screens."
|
||||||
let availability: PlatformAvailability = .all
|
let availability: PlatformAvailability = .all
|
||||||
let syncPolicy: SyncPolicy = .never
|
let syncPolicy: SyncPolicy = .never
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user