Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created October 25, 2017 11:23
Show Gist options
  • Save azamsharp/e69ed91504438ee93ef55b39e0b08fce to your computer and use it in GitHub Desktop.
Save azamsharp/e69ed91504438ee93ef55b39e0b08fce 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