From 4adcb63797cf45db123dd8bcb4c0db0903f95173 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 14 Jan 2026 12:20:10 -0600 Subject: [PATCH] Update SecureStorageSample Watch App, SecureStorgageSample --- .../Services/Handlers/UserProfileWatchHandler.swift | 6 +++++- SecureStorgageSample/SecureStorgageSampleApp.swift | 10 +++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/SecureStorageSample Watch App/Services/Handlers/UserProfileWatchHandler.swift b/SecureStorageSample Watch App/Services/Handlers/UserProfileWatchHandler.swift index b473e5f..5632b70 100644 --- a/SecureStorageSample Watch App/Services/Handlers/UserProfileWatchHandler.swift +++ b/SecureStorageSample Watch App/Services/Handlers/UserProfileWatchHandler.swift @@ -8,10 +8,14 @@ final class UserProfileWatchHandler: WatchDataHandling { private let store: WatchProfileStore private let decoder = JSONDecoder() - init(store: WatchProfileStore = .shared) { + init(store: WatchProfileStore) { self.store = store } + convenience init() { + self.init(store: .shared) + } + func handle(data: Data) { do { let profile = try decoder.decode(UserProfile.self, from: data) diff --git a/SecureStorgageSample/SecureStorgageSampleApp.swift b/SecureStorgageSample/SecureStorgageSampleApp.swift index 6d1fdca..da850b2 100644 --- a/SecureStorgageSample/SecureStorgageSampleApp.swift +++ b/SecureStorgageSample/SecureStorgageSampleApp.swift @@ -12,12 +12,12 @@ import LocalData struct SecureStorgageSampleApp: App { init() { _ = WatchConnectivityService.shared - do { - try StorageRouter.shared.registerCatalog(AppStorageCatalog.self) - } catch { - assertionFailure("Storage catalog registration failed: \(error)") - } Task { + do { + try await StorageRouter.shared.registerCatalog(AppStorageCatalog.self) + } catch { + assertionFailure("Storage catalog registration failed: \(error)") + } await StorageRouter.shared.registerKeyMaterialProvider( ExternalKeyMaterialProvider(), for: SampleKeyMaterialSources.external