Last active
November 26, 2018 15:26
-
-
Save Sajjon/923858af437e248423635f0efd603283 to your computer and use it in GitHub Desktop.
Medium article: SLC part 1 - ViewModelled
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 RxSwift | |
| protocol EmptyInitializable { | |
| init() | |
| } | |
| protocol ViewModelled: EmptyInitializable { | |
| associatedtype ViewModel: ViewModelType | |
| var inputFromView: ViewModel.Input.FromView { get } | |
| func populate(with viewModel: ViewModel.Output) -> [Disposable] | |
| } | |
| // MARK: - Default implementation | |
| extension ViewModelled { | |
| // Making `populate` "optional" | |
| func populate(with viewModel: ViewModel.Output) -> [Disposable] { return [] } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment