Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created October 25, 2017 11:23
Show Gist options
  • Save azamsharp/367238a99ee473d2cdc6d24a58d56849 to your computer and use it in GitHub Desktop.
Save azamsharp/367238a99ee473d2cdc6d24a58d56849 to your computer and use it in GitHub Desktop.
override func viewDidLoad() {
super.viewDidLoad()
self.webservice = Webservice()
self.viewModel = ArticleListViewModel(service: self.webservice)
self.title = self.viewModel.title
loadArticles2()
}
// Calling the webservice from the view model
private func loadArticles2() {
self.viewModel.get { articleListViewModel in
self.viewModel = articleListViewModel
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment