SwiftUI Integration
Integrating the Composable Architecture into a SwiftUI application.
Overview
The Composable Architecture can be used to power applications built in many frameworks, but it was designed with SwiftUI in mind, and comes with many powerful tools to integrate into your SwiftUI applications.
Alerts and dialogs
SwiftUI/View/alert(_:)
SwiftUI/View/confirmationDialog(_:)
protocol _EphemeralState<Action>
Loosely represents features that are only briefly shown and the first time they are interacted with they are dismissed. Such features do not manage any behavior on the inside.
Presentation
SwiftUI/Binding/scope(state:action:fileID:filePath:line:column:)
Navigation stacks and links
SwiftUI/Binding/scope(state:action:)-35r82
SwiftUI/NavigationStack/init(path:root:destination:fileID:filePath:line:column:)
SwiftUI/NavigationLink/init(state:label:fileID:filePath:line:column:)
Bindings
Working with SwiftUI bindings
Learn how to connect features written in the Composable Architecture to SwiftUI bindings.
Read Moreprotocol BindableAction<State>
An action type that exposes a
binding
case that holds aBindingAction
.struct BindingAction<Root>
An action that describes simple mutations to some root state at a writable key path.
struct BindingReducer<State, Action, ViewAction>
A reducer that updates bindable state when it receives binding actions.
Deprecations
Deprecations
Review unsupported SwiftUI APIs and their replacements.
Read More