fix: add Sendable requirement to TypedAppStorageValue

This commit is contained in:
Shibo Lyu 2025-06-14 19:56:19 +08:00
parent 4c932cb336
commit 27d4026050

View file

@ -3,7 +3,7 @@ import SwiftUI
/// The protocol that typed app storage values must conform to.
///
/// The most important requirement is conformance to `Codable`. Use ``TypedAppStorage`` in SwiftUI views to store and fetch conforming data.
public protocol TypedAppStorageValue: Codable {
public protocol TypedAppStorageValue: Codable, Sendable {
/// The actual key under which this type of data is stored.
static var appStorageKey: String { get }
/// The default value to return, if there's no data under the specified ``appStorageKey``.