Repository navigation
Releases
v1.0.0
First stable release of State Machine (swift-state-machine), a Swift package for modeling workflows as typed phase graphs generated from a single enum.
Each phase holds only its own data and exposes only its declared transitions. Owned values advance only through consuming phase methods, and Observed values prepare revision-checked proposals for commit(_:), so wrong-phase calls fail to compile. When an event targets whatever phase is current, Local and managed hosts also route inputs dynamically through send(_:), rejecting invalid inputs without changing state.
Transitions stay synchronous and return inert effect descriptions while generated hosts run asynchronous operations and track operation authority. After cancellation, scope invalidation, or leaving an operation's active phases, late results are discarded as stale instead of overwriting newer state.
Requires Swift 6.4 in Swift 6 language mode on Apple platforms. Ships StateMachine (macros and runtime), StateMachineUI (SwiftUI and UIKit presentations), and StateMachineTesting (test helpers with no test-framework dependency).
.package(url: "https://github.com/kylehughes/swift-state-machine.git", from: "1.0.0")See the API documentation for guides, platform requirements, and symbol references.