Learn how to structure your iOS App with declarative state changes using Point-Free's The Composable Architecture (TCA) library.

Overview

spacex-tca

Hi there! ๐Ÿ‘‹

This application presents a list of SpaceX launches and it was architected using The Composable Architecture. It was built as a proof-of-concept to demonstrate how The Composable architecture works and how it can be applied to SwiftUI projects.

It serves as the base of the writing of the blog post "A Tour of The Composable Architecture with the SpaceX API ๐Ÿš€ ".

This application explores an open source SpaceX API ๐Ÿš€ to fetch launches data.

This is how the application looks like:

Exploring the Composable Architecture

TCA focuses on different aspects around developing applications of different size and complexity. It offers concepts to solve various problems, including:

  • State management: Each app consists of some sort of state. TCA offers a concept to manage and share state.
  • Composition: This enables you to develop smaller features in isolation and compose them together to form the whole app.
  • Side effects: These are often hard to understand and test. TCA tries to change this by defining a way to handle them.
  • Testing: This is always important and TCA makes it easy to accomplish.
  • Ergonomics: A framework is available that provides a convenient API to implement all components.

Understanding the Components of TCA

An application built with TCA consists of five main components that help to model your app:

  • State: Often, a collection of properties represents the state of an app or a feature spread over many classes. TCA places all relevant properties together in a single type.
  • Actions: An enumeration including cases for all events that can occur in your app, e.g., when a user taps a button, when a timer fires or an API request returns.
  • Environment: A type wrapping all dependencies of your app or feature. For example, these can be API clients with asynchronous methods.
  • Reducer: A function that uses a given action to transform the current state to the next state.
  • Store: A place your UI observes for changes and where you send actions. Based on these actions, it runs reducers.
You might also like...
Recipes app written in SwiftUI using Single State Container
Recipes app written in SwiftUI using Single State Container

swiftui-recipes-app Recipes app is written in SwiftUI using Single State Container This app implemented as an example of a Single State Container conc

Github repo search with using mvvm-c and clean architecture and using combine swift

GitSearchWithMVVM-C-CleanArchitecture Github repo search with using mvvm-c and clean architecture and using combine swift. Content Overview How To Run

IOS e-commerce app developed using MVVM architecture with Swift UI
IOS e-commerce app developed using MVVM architecture with Swift UI

IOS e-commerce app developed using MVVM architecture with Swift UI.

Introducing SwiftUI. A declarative way to create User Interfaces with Swift.

SwiftUI - Landmarks Introducing SwiftUI. A declarative way to create User Interfaces with Swift. SwiftUI was introduced at WWDC 2019 by Apple. It is t

GroceryMartApp-iOS-practice - To Practice fundamental SwiftUI feature like navigation, state mamagement, customazing etc
GroceryMartApp-iOS-practice - To Practice fundamental SwiftUI feature like navigation, state mamagement, customazing etc

๐Ÿฅฌ GroceryMartApp-iOS-practice ์•„๋ž˜์˜ ๋‚ด์šฉ์€ ์Šค์œ—ํ•œ SwiftUI ์ฑ…์˜ ์‹ค์ „ ์•ฑ ๊ตฌํ˜„ํ•˜๊ธฐ ์„ ๋ฐ”ํƒ•์œผ๋กœ ์ •๋ฆฌํ•œ ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค

SwiftUI sample app using Clean Architecture. Examples of working with CoreData persistence, networking, dependency injection, unit testing, and more.
SwiftUI sample app using Clean Architecture. Examples of working with CoreData persistence, networking, dependency injection, unit testing, and more.

Articles related to this project Clean Architecture for SwiftUI Programmatic navigation in SwiftUI project Separation of Concerns in Software Design C

A SwiftUI implementation of React Hooks. Enhances reusability of stateful logic and gives state and lifecycle to function view.

SwiftUI Hooks A SwiftUI implementation of React Hooks. Enhances reusability of stateful logic and gives state and lifecycle to function view. Introduc

An iOS template project using SwiftUI, Combine and MVVM-C software architecture
An iOS template project using SwiftUI, Combine and MVVM-C software architecture

SwiftUI-MVVM-C A template project that uses SwiftUI for UI, Combine for event handling, MVVM-C for software architecture. I have done some small proje

Owner
Tiago Henriques
๐Ÿ“ฑ iOS Software Engineer
Tiago Henriques
ScrumdingerTCA - Appleโ€™s tutorial app recreated using The Composable Architecture

ScrumdingerTCA Appleโ€™s tutorial app recreated using The Composable Architecture

Pat Brown 9 Nov 29, 2022
A library to derive and compose Environment's in The Composable Architecture.

ComposableEnvironment This library brings an API similar to SwiftUI's Environment to derive and compose Environment's in The Composable Architecture.

Thomas Grapperon 129 Dec 14, 2022
A library that provides undo semantics for the Composable Architecture with optional bridging tofUndoManager.

Swift Composable Undo A library that provides undo semantics for the Composable Architecture with optional bridging with UndoManager. Motivation It is

Aacapella Holdings Pty. Ltd. 17 Nov 18, 2022
Open source game built in SwiftUI and the Composable Architecture.

isowords This repo contains the full source code for isowords, an iOS word search game played on a vanishing cube. Connect touching letters to form wo

Point-Free 2.1k Jan 1, 2023
Pointfree's Composable Architecture Relay

RelayStore Pointfree's Composable Architecture Relay to hook into Actions sent to the Store from outside. Read more at Observe actions in The Composab

Alejandro Martรญnez 3 May 29, 2022
This is a mastodon sample SwiftUI app implemented with the architecture of state management with normalized cache.

MastodonNormalizedCacheSample This is a mastodon sample SwiftUI app. This app is implemented with the architecture of state management with Normalized

null 5 Nov 27, 2022
IOS-Quiz-App- - A trivia quiz app built with Swift using MVC structure

Quiz App A trivia quiz app built with Swift using MVC structure. Default Quiz

null 0 Feb 25, 2022
Best architecture for SwiftUI + CombineBest architecture for SwiftUI + Combine

Best architecture for SwiftUI + Combine The content of the presentation: First of the proposed architectures - MVP + C Second of the proposed architec

Kyrylo Triskalo 3 Sep 1, 2022
Mvi Architecture for SwiftUI Apps. MVI is a unidirectional data flow architecture.

Mvi-SwiftUI If you like to read this on Medium , you can find it here MVI Architecture for SwiftUI Apps MVI Architecture Model-View-Intent (MVI) is a

null 12 Dec 7, 2022