From 4ad6cc3d6a9fc90248c2a33bed60dfc38a0130a5 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 16 Jan 2026 22:13:09 -0600 Subject: [PATCH] Update docs: README --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a02be70..8636004 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ SecureStorageSample Watch App/ ## Storage Design Philosophy -This app intentionally uses a **Type-Safe Storage Design**. Unlike standard iOS development which uses string keys (e.g., `UserDefaults.standard.string(forKey: "user_name")`), this library requires you to define a `StorageKey` type. +This app intentionally uses a **Type-Safe Storage Design**. Unlike standard iOS development which uses string keys (e.g., `UserDefaults.standard.string(forKey: "user_name")`), this library requires you to define `StorageKey` values. ### Why types instead of strings? 1. **Safety**: The compiler prevents typos. You can't accidentally load from `"user_name"` and save to `"username"`. @@ -144,7 +144,7 @@ The app demonstrates various storage configurations: - Global sync configuration (max file size) in app `init` ### Data Migration -- **Fallback**: Automatically moves data from `LegacyMigrationSourceKey` to `ModernMigrationDestinationKey` on first access using protocol-based migration. +- **Fallback**: Automatically moves data from `legacyMigrationSource` to `modernMigrationDestination` on first access using protocol-based migration. - **Transforming**: Converts a legacy full-name string into a structured `ProfileName`. - **Aggregating**: Combines legacy notification + theme settings into `UnifiedSettings`. - **Conditional**: Migrates app mode only when the version rule is met. @@ -170,6 +170,7 @@ This approach centralizes infrastructure settings and avoids hardcoding environm ## Notes - Storage keys are now split into one file per key and grouped by domain; platform-focused keys live in `StorageKeys/Platform` with comments calling out availability/sync focus. +- Keys are declared as `StorageKey` static properties via constrained extensions (e.g., `extension StorageKey where Value == String`). - The shared model/constants live in `SharedPackage` (`SharedKit`) to keep the watch/iOS data contract centralized. - Keychain service IDs and App Group identifiers are centralized in `SharedKit/Constants/StorageServiceIdentifiers.swift` to avoid hardcoded strings in keys. - The watch app uses a handler-based WatchConnectivity layer so new payload types can be added in `Services/Handlers` without bloating the main service.