Last active
March 14, 2019 10:39
-
-
Save IsaAliev/a8f6688a18bbc28259bf6f8ec56c0982 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 Foundation | |
class ViewModel: StatyViewModel { | |
var state = SObservable<State?>(nil) | |
func setup() { | |
setupStateController(BasicStateController.self) | |
let inState = LoadingState() | |
stateController.transitTo(inState) | |
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { | |
let newState = AlertState(message: "Staty First") | |
let oneMoreState = AlertState(message: "Staty Second") | |
let loading = LoadingState() | |
self.stateController.transitTo(newState) | |
self.stateController.transitTo(oneMoreState) | |
self.stateController.transitTo(loading) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment