Skip to content
ChiefVenzox edited this page Jun 5, 2026 · 2 revisions

SwiftState Wiki

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.

Start Here

Guides

Minimal Example

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
)

Recommended Learning Path

  1. Add the package with Installation.
  2. Copy the starter app from Xcode Integration.
  3. Learn the architecture in Core Concepts.
  4. Add real async work with Async Effects.
  5. Debug state changes with Time Travel Debugger.

Clone this wiki locally