Table reminder: if a view controller defines it’s own table, it’s probably doing it wrong. If a view controller uses tables, almost every time it should be a subclass of UITableViewController. Doing that, you get a few things for free, in summary:

  • No need to create a .xib or the table view if the view only contains a table
  • Automatically sets delegate and dataSource to self
  • When the table view is about to appear the first time it’s loaded, the table-view controller reloads the table view’s data.
  • Clears table selection every time the table view is displayed.
  • When the table view has appeared, the controller flashes the table view’s scroll indicators.
  • It implements the superclass method setEditing:animated: so that if a user taps an Edit|Done button in the navigation bar, the controller toggles the edit mode of the table.

There are a few places with potentially unnecessary code:

~/automattic/WordPress-iOS (notifications-wptable ✘)✭ ᐅ grep -rl --exclude-dir=Vendor '^@property.*UITableView\b' *                                 
Classes/AddUsersBlogsViewController.h
Classes/EditSiteViewController.h
Classes/JetpackSettingsViewController.h
Classes/NotificationsCommentDetailViewController.h
Classes/NotificationsFollowDetailViewController.h
Classes/NotificationsTableViewDatasource.h
Classes/PostMediaViewController.h
Classes/SidebarViewController.h
Classes/XMLSignupViewController.h