Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. /*
  2. * Protocol that defines the view input methods.
  3. */
  4. protocol ArticlesViewInterface: class {
  5. func showArticlesData(articles: [Article])
  6. func showNoContentScreen()
  7. }
  8.  
  9. /*
  10. * A view responsible for displaying a list
  11. * of articles fetched from some source.
  12. */
  13. class ArticlesViewController : UIViewController, ArticlesViewInterface
  14. {
  15. // Reference to the Presenter's interface.
  16. var presenter: ArticlesModuleInterface!
  17.  
  18. /*
  19. * Once the view is loaded, it sends a command
  20. * to the presenter asking it to update the UI.
  21. */
  22. override func viewDidLoad() {
  23. super.viewDidLoad()
  24. self.presenter.updateView()
  25. }
  26.  
  27. // MARK: ArticlesViewInterface
  28.  
  29. func showArticlesData(articles: [Article]) {
  30. self.articles = articles
  31. self.tableView.reloadData()
  32. }
  33.  
  34. func showNoContentScreen() {
  35. // Show custom empty screen.
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement