Highway is an Redux-like architecture pattern implementation with Swift.
- Features
- Tutorials (Step by step guide)
- Examples
- Requirements
- Installation (Cocoapods / SPM)
- Schemes
- Alternatives
- Tools used in project
- Author
- Credits and thanks
- Child stores
- Fast state updates
- 100% business logic code coverage
- Lightweight
- Do not use 3rd party libraries
- Can be used with SwiftUI
- Support structs & classes for state (structs preferred)
- Thread safe
- Can be used with async/await
createMiddleware({ dispatch, getState, action in
switch action {
case .randomize:
Task.init {
let rand = await generateRandomValue()
dispatch(.receiveRandomValue(Int(rand)))
}
}
})
- SimpleView: SwiftUI View with updates
- ListWithAimations: Data Driven UI using SwiftUI List
- Snapshot testing: Snapshot tests based on fast unit tests
- Unit testing business logic: Custom logic tests / Integration tests for Model Layer
- Counter: Lighweight multi store app (Single view controller with multiple child view controller)
- SocketPingPong: An app with stream of events (like web socket or server side events)
- ReusableViewControllers: Reuse view controller or view which was written with imperative style and similar example using ViewStore
- Animation: Animation inside TableView cells using DiffableDataSource & SwiftUI List views(items)
- TableViewsSync: TableView with animations (deletions/insertions) and syncronisation
- InfiniteScroll: Enterprise solution app (with Dependency Injection, Flow Coordinator e.t.c.)
preview_low.mov
- iOS: 13.0
- Swift: 5.4
Highway is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Highway'
Also you can integrate framework as SPM package
- UI generate Action
- Action goes to Store
- Store mutate State (if needed)
- new State goes to UI
- Action goes to Middleware
- Middleware generate new action (if needed)
- new Action from Middleware goes to Store
- Store mutate State (if needed)
- new State goes to UI
- Multiple Stores share single State
- State not copied for each new SubStore
- State mutation goes down to parent store
- Mobius.swift
- ReSwift
- ReCombine
- Swift Composable Architecture
- Tea In Swift
- SwiftRex
- Katana
- ReactorKit
- Tempura
- RxFeedback
- More
- rbenv: Manage your app's Ruby environment (quote from rbenv github web page)
- Bundler: The best way to manage a Ruby application's gems (quote from Bundler web page)
- Git LFS: An open source Git extension for versioning large files (quote from git-lfs web page)
- Add pros and cons to alternatives
- Add area of responsibility for Highway types
Dmitrii Cooler, coolerov333@gmail.com
The following people gave feedback on the library at its early stages and helped make the library what it is today:
Special thanks to:
- Aleksey Alekseev who helped me to improve library performance
- Dmitii Bobrov with major feedback on early concepts
Highway is available under the MIT license. See the LICENSE file for more info.