MappedState

@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
@propertyWrapper
public struct MappedState<State> : DynamicProperty

Retrieves a mapping of the application state from the environment and provides it to a property in a SwiftUI view. Use the connect(updateWhen:mapState:) method to first inject the state from a parent view.

struct MyView : View {

  @MappedState var todoList: TodoList

}
  • Undocumented

    Declaration

    Swift

    public var wrappedValue: State { get }
  • Undocumented

    Declaration

    Swift

    public var projectedValue: Binding<State> { get }
  • Undocumented

    Declaration

    Swift

    public var binding: Binding<State> { get }
  • Undocumented

    Declaration

    Swift

    public init()