Skip to content

Instantly share code, notes, and snippets.

@cipolleschi
Created April 26, 2020 12:57
Show Gist options
  • Select an option

  • Save cipolleschi/53d7148bd79df10d5660673f5a8bccc3 to your computer and use it in GitHub Desktop.

Select an option

Save cipolleschi/53d7148bd79df10d5660673f5a8bccc3 to your computer and use it in GitHub Desktop.
Basic structure of viewmodel and view
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