Created
April 26, 2020 12:57
-
-
Save cipolleschi/53d7148bd79df10d5660673f5a8bccc3 to your computer and use it in GitHub Desktop.
Basic structure of viewmodel and view
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Tempura | |
| import BonMot | |
| import PinLayout | |
| struct AVM: ViewModelWithState { | |
| init(state: AppState) { | |
| } | |
| } | |
| class AView: UIView, ViewControllerModellableView { | |
| typealias VM = AVM | |
| func setup() { | |
| } | |
| func style() { | |
| } | |
| func update(oldModel: VM?) { | |
| guard let model = self.model else { | |
| return | |
| } | |
| } | |
| override func layoutSubviews() { | |
| super.layoutSubviews() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment