The Composable Architecture (TCA) helps Swift developers model features with explicit state, actions, and reducers. It supports SwiftUI, UIKit, and Apple platforms.
Overview
The Composable Architecture is a Swift package for building applications with a consistent structure around state, actions, reducers, and a centralized store. It targets SwiftUI and UIKit on iOS, macOS, iPadOS, visionOS, tvOS, and watchOS.
Features are defined as reducers that evolve state and declare side effects, which the store runs and feeds back into the UI. The design emphasizes breaking large features into composable modules, sharing state across screens, and expressing external communication in a testable way.
Testing uses a TestStore to step through user flows, assert state changes, and control dependencies such as network clients with mock implementations. Documentation covers dependencies, navigation, concurrency, bindings, and performance, and numerous example projects are included.
Installation is via Swift Package Manager in Xcode or shared frameworks when multiple targets need access. Community discussion happens through project discussions and the Point-Free community Slack.
Key features
- State, action, reducer model
- Centralized Store runtime
- Composable feature modules
- Testable side effects
- TestStore integration tests
- SwiftUI and UIKit support
- Dependency injection helpers
- Navigation and shared state
Use cases
- Structuring SwiftUI features
- UIKit apps with shared state
- Unit and integration testing
- Modular app architecture
- Isolating network effects