Workshops are designed to give developers who have no experience with Swift an overview of modern iOS-apps development and share with more experienced iOS-developers knowledge about unidirectional architectures and particularly Composable Architecture.
Workshops require professional programming knowledge. If you have no experience with Swift it's okay. You can drop if at any time they get harder. And vice versa; you can join any time by checking out the latest commit in this repo.
It would be much easier for you to follow if you have some experience in:
- reactive programming
- functional programming
But it's not required.
We'll be building a slightly modified version of Babbel's code challenge. Here's the app interface:
Here's the code of the final application that we're aiming for: https://github.com/AlexShubin/FallingWords2
- Building a basic game app using SwiftUI
- Solving UI/Logic separation problems
- Introducing the app state and sharing it between different scenes
- Introducing the app state reducer
- Building and testing service layer using Combine
- Introducing side-effects and Composable Architecture
- Introducing Reducers composition, using Composable Architecture to modularize the app
- Testing the app modules
Setup Xcode 11.7 (should be the latest version from the App Store). Make sure you ran it at least once in order to install "Additional Components" (you'll be guided).
Using SwiftUI we built a single screen game with logic and UI in the View.
Game crashes at the end of the rounds. We have no game start/results screen, we have no score screen. We have tightly coupled UI and game logic in the view which makes it untestable.
- We successfully separated UI and logic introducing
AppState
andAppStore
- We made state read-only accessible for views
- We built
GameStartView
- We fixed the bugs from the previous session
- We still have no score screen and no
TabBar
- AppStore manages the concrete implementation of the state
GameStartView
lacks the results section- Hardcoded set of words
- Fixed the state update on the game start
- Introduced the reducer
- Separated the architectural part from the concrete implementation
- Implemented
ScoreHistoryView
andTabBar
- Hardcoded set of words (lack of side-effects)
- Modularization problem
- Reducer implicitly creates
Date
andUUID
ScoreHistoryView
is responsible for formatting datesGameStartView
lacks the results section
Small bugs:
- New result appends instead of being inserted at 0 position
- Fixed small bugs
- Implemented a score results section in the
GameStartView
- Implemented a service layer
- Hardcoded set of words (lack of side-effects)
- Modularization problem
- Reducer implicitly creates
Date
andUUID
ScoreHistoryView
is responsible for formatting dates- No tests for the service layer
- Finished the service layer
- Introduced side-effects
- Modularization problem
- Reducer implicitly creates
Date
andUUID
ScoreHistoryView
is responsible for formatting dates- Syncronous side-effects in the reducer
- Made an overview of most popular unidirectional architectures: ReSwift, RxFeedback, Composable Architecture
- Introduced asyncronous side effects
- Introduced
Environment
and injected Services into the reducer
- Modularization problem
ScoreHistoryView
is responsible for formatting dates
- Started solving the modularization problem with Composable Architecture
- Modularization problem
ScoreHistoryView
is responsible for formatting dates
- Using Composable Architecture for every module in the app
ScoreHistoryView
is responsible for formatting datesStartGameView
receives unnecessary updates
Tackling final problems and final thoughts.