This package contains a set of useful entities to develop scalable iOS applications using either SwiftUI or UIKit along with Combine.
- Swift 5.7 or newer
- iOS 14.0 or newer
You can install this package using Swift Package Manager by adding the following line to the dependencies
in your Package.swift
file:
.package(url: "https://github.com/purenative/StatefulArch.git", .upToNextMajor(from: "1.0.0"))
StatetefulArch proposes to split screens into independent parts called modules which of them consists of three main components - View, Interceptor and State.
View is responsible for user interface and it doesn't contain any business logic or input data validations. Also it delegates user actions processing to Interceptor.
Interceptor processes user actions received from View and updates State. Interceptor may contain input data validations but it's not responsible for business logic directly.
There is another entity in this architecture called Scenario which is responsible for business logic. Scenario isn't displayed on the diagram due to business logic optionality - some screens may not contain business logic such as screens which only consist of static content.
This entity stores screen's state and determines View's behavior.
Don't forget to open an issue if you found a bug or have a question. Feel free to fork this repository and open a pull request if you fixed an existing feature or implemented a new one.
StatefulArch is released under the MIT license. See LICENSE for details.