PersistStorage

@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
@propertyWrapper
public struct PersistStorage<Value> : DynamicProperty

A type that conforms to DynamicProperty to facilitate automatically updating SwiftUI Views.

  • Declaration

    Swift

    public var wrappedValue: Value { get nonmutating set }
  • A Binding to the wrappedValue. Supports animations.

    Declaration

    Swift

    public var projectedValue: Binding<Value> { get }
  • The Persister used to persist and retrieve the stored value.

    Declaration

    Swift

    public var persister: Persister<Value> { get }
  • Create a new PersistStorage using the provided persister to persist and retrieve values.

    Declaration

    Swift

    public init(persister: Persister<Value>)

    Parameters

    persister

    The Persister used to persist and retrieve the stored value.