You have to write the delegate and protocol methods regardless of which of the two approaches you take.
There are only two possible reasons you should choose to use UIViewController
over UITableViewController
when you need a view controller with a table view:
- You need the table view to be smaller than the view controller’s view.
- You need to add additional views to the view controller that don’t scroll with the table view (though there are ways to solve this with
UITableViewController
).
Here are all of the things that UITableViewController
does for you that you would need to replicate:
- Defines and setups up the
UITableView
. - Sets itself as the table view’s dataSource and delegate.
- Overrides the
setEditing:animated:
method to also set theediting
property of the table view. - Deselects the last selected row in the
viewWillAppear:
method depending on theclearsSelectionOnViewWillAppear
property. - Flashes the table view’s scrollbars in the
viewDidAppear:
method. - Hooks up the refresh control (as of iOS 6).
- Reloads the table view the first time it will appear.
- Adjusts the table view’s
contentInset
(as of iOS 7). - Scrolls the table view as needed when the keyboard appears.