Types of table. View controller and table view controller?

I looked at many guides on table views, table cells, etc. When creating a table view, why choose a UIViewController over a UITableViewController in Xcode? For example, what would be the main advantages of creating a UIViewController and then adding a tableView object just by creating a UITableViewController? I have already created a large number of scenes in the storyboard, and I hope I did not stop there. Hope my question is clear as I am new to coding!

+4
source share
2 answers

UIViewControllergives you more control over tableview, not UITableViewController. You should use it UITableViewControlleronly when you are just interested in the table view in the controller. But if you want to add more subviews / controls in a controller other than tableview, then you should use UIViewController.

Example:

If you just want to display a list of grocery items with some headers and footers, then the tableviewcontroller should be prioritized. But if you want to display mail items in a tableview, you will need additional buttons to change the items in the mail (tableview). In the following case, you will use the viewcontroller. I hope my point is clear.

+4
source

, View Controller - , , UItableview. UITableViewController UIViewController, , . , , UITableView. , , UITableViewController, , UIViewController, UIViewController.

0

Source: https://habr.com/ru/post/1538131/


All Articles