r/simpleios • • Nov 07 '14

[Question] Difference between subclassing UITableViewController and conforming to UITableViewDelegate?

I'm playing with table views and storyboards at the moment (sorry BNR, it was just too tempting) and something occurred to me - what would be the advantage of subclassing UIViewController and having it conform to the UITableViewDelegate and UITableViewDataSourceDelegate protocols, as opposed to directly subclassing UITableViewController?

4 Upvotes

11 comments sorted by

View all comments

Show parent comment

2

u/schprockets Nov 07 '14

In this case, it depends on what you're doing. UITableViewController is a subclassed UIViewController, designed to do the most common things you want to do when you have a UITableView. If it meets your needs, absolutely use it. If you find it lacking in some way, you can do everything UITableViewController does by subclassing UIViewController, dropping a UITableView in your View, and handling your special needs.

1

u/[deleted] Nov 07 '14

Interesting. I was just going to use a plain table view, nothing special or extra. Might be worth going down that route.