Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableViewController vs UIViewController

Tags:

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 views with UITableViews in them? I ask because I want my views with UITableViews to inherit from a base view controller (which inherits from UIViewController). If I use a UITableViewController then having a base class for all my views becomes more difficult.

like image 945
Adam Johns Avatar asked Jan 18 '14 05:01

Adam Johns


People also ask

What is the difference between UIView and UIViewController?

They are separate classes: UIView is a class that represents the screen of the device of everything that is visible to the viewer, while UIViewController is a class that controls an instance of UIView, and handles all of the logic and code behind that view.

What is UITableViewController?

A view controller that specializes in managing a table view.

What is the difference between Table View and Table View Controller?

A table view is an instance of the UITableView class, which is a subclass of UIScrollView. Table view cells, which are the repeatable rows, or views, shown in the table view. A table view cell is an instance of a UITableViewCell class, and that class is often subclassed to create custom table view cells.

What is a navigation controller?

NavController manages app navigation within a NavHost . Apps will generally obtain a controller directly from a host, or by using one of the utility methods on the Navigation class rather than create a controller directly. Navigation flows and destinations are determined by the navigation graph owned by the controller.


1 Answers

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.

like image 58
matt Avatar answered Sep 28 '22 19:09

matt