UITableViewController vs UIViewController

后端 未结 3 1964
夕颜
夕颜 2021-02-04 00:57

What all does UITableViewController get me that makes it actually useful? Is there any bonus is using it instead of just using a UIViewController for v

相关标签:
3条回答
  • 2021-02-04 01:17

    Nothing more then the boilerplate code ready for setting the data source and connection to your tableView object, some getters and setter to make your life easy if you not want to put your effort to do the same thing which is available.

    But in your case for SubClass its not fit to have UItableViewController

    0 讨论(0)
  • 2021-02-04 01:19

    Not much. It provides some conveniences, but you never really need it; I often don't use it.

    The main things, aside from the automatic setup when you create one in the storyboard, are the three properties tableView, clearsSelectionOnViewWillAppear, and refreshControl. But they don't do anything you can't do yourself.

    0 讨论(0)
  • 2021-02-04 01:19

    Well I do think both Retro and matt's answer are correct, from personal experience it is much easier and less "hackY" to use UITableViewController with UIRefreshControl, then trying to get UIRefreshControl work with UIViewController with a UITableView.

    0 讨论(0)
提交回复
热议问题