-
Notifications
You must be signed in to change notification settings - Fork 1
Home
ChiefVenzox edited this page Jun 5, 2026
·
2 revisions
SwiftState is a lightweight SwiftUI state management framework built around predictable unidirectional data flow, composable reducers, async effects, middleware, bindings, and a time-travel debugger.
Use this wiki when you want to add SwiftState to an Xcode project and understand the core app architecture.
import SwiftState
struct AppState: State {
var count = 0
}
enum AppAction: Action {
case increment
}
let appReducer: Reducer<AppState> = { state, action in
guard let action = action as? AppAction else { return }
switch action {
case .increment:
state.count += 1
}
}Create one store at your app entry point, inject it into SwiftUI with environmentObject, and dispatch actions from views.
@StateObject private var store = Store(
initialState: AppState(),
reducer: appReducer
)- Add the package with Installation.
- Copy the starter app from Xcode Integration.
- Learn the architecture in Core Concepts.
- Add real async work with Async Effects.
- Debug state changes with Time Travel Debugger.