SwiftUI

  • Declaration

    Swift

    @available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
    extension View
  • 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
    
    }
    
    See more

    Declaration

    Swift

    @available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
    @propertyWrapper
    public struct MappedState<State> : DynamicProperty
  • Injects a function as a property in a view to dispatch actions to the provided store.

    struct MyView : View {
    
      @MappedDispatch() var dispatch
    
      func handleClick() {
        dispatch(AppAction.doSomething())
      }
    
    }
    
    See more

    Declaration

    Swift

    @available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
    @propertyWrapper
    public struct MappedDispatch : DynamicProperty
  • Makes a view connectable to the application state.

    See more

    Declaration

    Swift

    @available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
    public protocol Connectable
  • Makes a view connectable to the application state using a parameter value.

    See more

    Declaration

    Swift

    @available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
    public protocol ParameterizedConnectable