SwiftUI
-
Declaration
Swift
extension View -
Retrieves a mapping of the application state from the environment and provides it to a property in a SwiftUI view.
See morestruct MyView : View { @MappedState var todoList: TodoList }Declaration
Swift
@available(*, deprecated) @propertyWrapper public struct MappedState<State> : DynamicProperty -
Injects a function as a property in a view to dispatch actions to the provided store.
See morestruct MyView : View { @MappedDispatch() var dispatch func handleClick() { dispatch(AppAction.doSomething()) } }Declaration
Swift
@available(*, deprecated, message: "Use @Environment(.\\actionDispatcher﹚ instead") @propertyWrapper public struct MappedDispatch : DynamicProperty -
A view that connects to the application state.
See moreDeclaration
Swift
public protocol ConnectableView : Connectable, View -
Binds a state to a setter based action for use by controls that expect a two-way binding value such as TextFields. This is useful for simple actions that are expected to be dispatched many times a second. It should be avoided by any complicated or asynchronous actions.
See morefunc map(state: AppState, binder: StateBinder) -> Props? { Props( todos: state.todos, orderBy: binder.bind(state.orderBy) { TodoListAction.setOrderBy($0) } ) }Declaration
Swift
public struct ActionBinder -
Binds a value with an action. Use the
See moreActionBinderto create an action binding.Declaration
Swift
@propertyWrapper public struct ActionBinding<Value>extension ActionBinding: Equatable
View on GitHub
SwiftUI Reference