Skip to content

Instantly share code, notes, and snippets.

@erikolsson
Created February 14, 2017 08:57
Show Gist options
  • Save erikolsson/5c399c107e72701686dd491c1de5b1c9 to your computer and use it in GitHub Desktop.
Save erikolsson/5c399c107e72701686dd491c1de5b1c9 to your computer and use it in GitHub Desktop.
protocol ViewModelType {
associatedtype Model
associatedtype Input
init(model: Model, input: Input)
}
class ViewModel: ViewModelType {
required init(model: Model, input: Input) {
/// bind input
}
struct Model {
let userId: String
}
struct Input {
let buttonTap: Observable<Void>
}
}
let model = ViewModel.Model(userId: "123")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment