Library Moduleswift-composable-architecture 1.18.0ComposableArchitecture

ComposableArchitecture

The Composable Architecture (TCA, for short) is a library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind. It can be used in SwiftUI, UIKit, and more, and on any Apple platform (iOS, macOS, tvOS, and watchOS).

ComposableArchitecture.md
import ComposableArchitecture

Module information

Declarations
618
Symbols
1431

Coverage

42.2 percent of the declarations in ComposableArchitecture are fully documented37.7 percent of the declarations in ComposableArchitecture are indirectly documented20.1 percent of the declarations in ComposableArchitecture are completely undocumented

Declarations

2.8 percent of the declarations in ComposableArchitecture are global functions or variables2.1 percent of the declarations in ComposableArchitecture are operators23.1 percent of the declarations in ComposableArchitecture are initializers, type members, or enum cases41.6 percent of the declarations in ComposableArchitecture are instance members5.7 percent of the declarations in ComposableArchitecture are instance subscripts1.3 percent of the declarations in ComposableArchitecture are functors1.3 percent of the declarations in ComposableArchitecture are protocols3.9 percent of the declarations in ComposableArchitecture are protocol requirements0.8 percent of the declarations in ComposableArchitecture are default implementations1.5 percent of the declarations in ComposableArchitecture are attached macros12.0 percent of the declarations in ComposableArchitecture are structures1.0 percent of the declarations in ComposableArchitecture are classes3.1 percent of the declarations in ComposableArchitecture are typealiases

Interfaces

74.1 percent of the declarations in ComposableArchitecture are unrestricted17.6 percent of the declarations in ComposableArchitecture are underscored8.3 percent of the declarations in ComposableArchitecture are SPI (unknown)
Module stats and coverage details

Additional Resources

Overview

This library provides a few core tools that can be used to build applications of varying purpose and complexity. It provides compelling stories that you can follow to solve many problems you encounter day-to-day when building applications, such as:

  • State management

    How to manage the state of your application using simple value types, and share state across many screens so that mutations in one screen can be immediately observed in another screen.

  • Composition

    How to break down large features into smaller components that can be extracted to their own, isolated modules and be easily glued back together to form the feature.

  • Side effects

    How to let certain parts of the application talk to the outside world in the most testable and understandable way possible.

  • Testing

    How to not only test a feature built in the architecture, but also write integration tests for features that have been composed of many parts, and write end-to-end tests to understand how side effects influence your application. This allows you to make strong guarantees that your business logic is running in the way you expect.

  • Ergonomics

    How to accomplish all of the above in a simple API with as few concepts and moving parts as possible.

Essentials

  • Getting started

    Learn how to integrate the Composable Architecture into your project and write your first application.

    Read More
  • Dependencies

    Learn how to register dependencies with the library so that they can be immediately accessible from any reducer.

    Read More
  • Testing

    Learn how to write comprehensive and exhaustive tests for your features built in the Composable Architecture.

    Read More
  • Navigation

    Learn how to use the navigation tools in the library, including how to best model your domains, how to integrate features in the reducer and view layers, and how to write tests.

    Read More
  • Sharing state

    Learn techniques for sharing state throughout many parts of your application, and how to persist data to user defaults, the file system, and other external mediums.

    Read More
  • Performance

    Learn how to improve the performance of features built in the Composable Architecture.

    Read More
  • Frequently asked questions

    A collection of some of the most common questions and comments people have concerning the library.

    Read More

Tutorials

  • doc:MeetComposableArchitecture
  • Building SyncUps

    The SyncUps application is a recreation of one of Apple’s more interesting demo applications, Scrumdinger. We recreate it from scratch using the Composable Architecture, with a focus on domain modeling, controlling dependencies, and testability.

    Read More

State management

  • protocol Reducer<State, Action>

    A protocol that describes how to evolve the current state of an application to the next state, given an action, and describes what Effects should be executed later by the store, if any.

  • struct Effect<Action>
  • class Store<State, Action>

    A store represents the runtime that powers the application. It is the object that you will pass around to views that need to interact with the application.

  • Sharing state

    Learn techniques for sharing state throughout many parts of your application, and how to persist data to user defaults, the file system, and other external mediums.

    Read More

Testing

Integrations

Migration guides

See Also

The collection of videos from Point-Free that dive deep into the development of the library.