Skip to content

Commit 0455ccd

Browse files
authored
Update README.md
1 parent f2234c3 commit 0455ccd

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

README.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ __iOS Build & Tests____
99

1010
[![Bitrise](https://app.bitrise.io/app/3eaf4fa6c0750504/status.svg?token=N7jdGFn6dvfLcuKZaBMW1g)](https://app.bitrise.io/app/3eaf4fa6c0750504#/builds)
1111

12-
A Kotlin multiplatform (Android/iOS) WT name game. Player is shown a picture and must guess the name. User can select from Cats, Dogs, or Trees! (aka Willowtree employees). The app utilizes the following:
12+
A Kotlin multiplatform (Android/iOS) name game. Player is shown a picture of a cat or dog and must guess the name. User can select from Cats, Dogs. The app utilizes the following:
1313
* [Ktor](https://ktor.io/clients/http-client.html) for networking
1414
* [Kotlinx Serialization](https://github.com/Kotlin/kotlinx.serialization)
1515
* [Multiplatform Settings](https://github.com/russhwolf/multiplatform-settings)
16-
* fork of [Reduks](https://github.com/beyondeye/Reduks/tree/3.x_kotlin_1_3) (kotlin redux implementation)
17-
16+
* [ReduxKotlin](https://github.com/reduxkotlin/redux-kotlin/)
1817

1918
## Android
2019
Building and testing the Android App can be completed with:
@@ -30,13 +29,7 @@ The iOS workspace in `/iOS/NameGame` can be open and ran from xCode or AppCode.
3029

3130
## Architecture
3231

33-
A `GameEngine` object holds the state of the app in a redux store and provides a methods for views (fragments/UIViewControllers) to "attach". The `GameEngine` is initialized in the Application class on Android, and the AppDelegate on iOS. Because this `GameEngine` and the store is created at the application scope, the application state survives between ViewControllers/Fragments and rotation. Each view must attach/detach from the GameEngine when it is visible. `GameEngine.attachView(view)` returns the appropriate presenter for the view.
34-
35-
`BaseNameGameViewFragment` & `BaseNameGameViewController` handle attaching/detaching the presenter at the appropriate lifecycle methods. Each Fragment/ViewController extends from these.
36-
37-
An MVP arch is used with a redux store as the 'Model'. This approach allows maximum reuse of code and a simple contract for the platforms to satisfy. Presenters send `ViewStates` (simple data classes with fields needed to render UI) to the View interface. The View implementation has a reference to the presenter, and calls methods on the presetner for user interaction. This creates a unidirectional dataflow:
38-
39-
User interaction -> Dispatch Action -> new state (reduce) -> view rendered by presenter
32+
More to come
4033

4134
## "Dumb Views"
4235
Views in this arch are truely 'dumb' - they should contain nearly no logic. They are responsible for rendering the view based on the `ViewState` given to them by the presenter. They are implemented for each platform and utilize native UI SDKs and libs for each platform. Android uses Fragments and iOS uses UIViewControllers.
@@ -45,9 +38,7 @@ Views in this arch are truely 'dumb' - they should contain nearly no logic. The
4538

4639
![](https://storage.googleapis.com/treestorage/ui_f_of_state.png)
4740

48-
49-
Presenters give a layer of control between subscribing to the new state and the View. Views subscribing directly to the store results in code and logic in the View which must be duplicated on each platform. Presenters are singleton objects that contain no state other than the previous AppState. This works while presenters are for an entire screen, which for this app is the case. Another approach will be needed if multiple instances of a given presenter are needed. The presenter is responsible for rendering the view given the AppState or the delta in AppState. The Reduks library has a port of Reselect, which allows calling code only when a property changes. Presenters pass `ViewState` to View methods. All transformations from Appstate -> ViewState are extension functions in `Transformations.kt`.
50-
41+
more to come
5142

5243

5344
![arch diagram](https://storage.googleapis.com/treestorage/Kotlin%20MPP%20Demo%20Arch.png)

0 commit comments

Comments
 (0)