Last active
March 22, 2016 14:26
-
-
Save joshdholtz/eddf51a52af8d35f376f to your computer and use it in GitHub Desktop.
Should add to dispose bag
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
class ViewController : UIViewController { | |
let viewModel = ViewModel() | |
private let disposeBag = DisposeBag() | |
override func viewDidLoad(){ | |
super.viewDidLoad() | |
self.viewModel.navigationVariable.asObservable() | |
.subscribeNext { data in | |
let newViewModel = NewViewModel(data) | |
let newViewController = NewViewController() | |
newViewController.viewModel = newViewModel | |
self.navigationController?.pushViewController(newViewController, animated:false) | |
}.addDisposableTo(disposeBag) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment