Last active
August 11, 2017 10:00
-
-
Save Herakleis/554a0b7eaf6ebc63302a3e1e85519556 to your computer and use it in GitHub Desktop.
This file contains 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 | |
import Action | |
protocol MyViewModelInputsType { | |
// Inputs headers | |
} | |
protocol MyViewModelOutputsType { | |
// Outputs headers | |
} | |
protocol MyViewModelActionsType { | |
// Actions headers | |
} | |
protocol MyViewModelType: class { | |
var inputs: MyViewModelInputsType { get } | |
var outputs: MyViewModelOutputsType { get } | |
var actions: MyViewModelActionsType { get } | |
} | |
final class MyViewModel: MyViewModelType { | |
var inputs: MyViewModelInputsType { return self } | |
var outputs: MyViewModelOutputsType { return self } | |
var actions: MyViewModelActionsType { return self } | |
// Setup | |
private let myViewModelService: MyViewModelServiceType | |
private let coordinator: SceneCoordinatorType | |
// Inputs | |
// Outputs | |
// ViewModel Life Cycle | |
init(service: MyViewModelServiceType, coordinator: SceneCoordinatorType) { | |
// Setup | |
self.myViewModelService = service | |
self.coordinator = coordinator | |
// Inputs | |
// Outputs | |
// ViewModel Life Cycle | |
} | |
// Actions | |
} | |
extension MyViewModel: MyViewModelInputsType, MyViewModelOutputsType, MyViewModelActionsType { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment