Table of Contents


Chapter 1: Introduction to AppState

AppState is a Swift package aimed at simplifying the management of application state in a thread-safe, type-safe way, with compatibility for SwiftUI. It offers a streamlined solution for maintaining state in your application, eases the management of shared data, and guarantees a fluid, responsive user interface.

Understanding AppState

AppState revolves around the idea of a centralized class, the Application, that holds all application-wide data. This class features built-in observability for reactive changes, meaning that any changes to data will trigger automatic notifications to relevant parts of your SwiftUI application, ensuring your user interface always mirrors the current state of your data.

Key Features of AppState

AppState comes with features designed to ease app development:

AppState Prerequisites and Requirements

AppState is compatible with Swift version 5.7 or later and is designed for various platforms, including iOS 15.0, watchOS 8.0, macOS 11.0, and tvOS 15.0 or later. It incorporates key concepts like structs, property wrappers, and observable objects. While these concepts form the basis of AppState, they are also crucial for any advanced Swift developer. Therefore, a solid understanding of these concepts is expected from developers using AppState.

Installation and Setup

Integrating AppState into your project is simple and can be accomplished through Swift Package Manager. For this, there are two main approaches: