I am trying to implement a user interface that is similar to the iPhone's Mail app.
What kind of layouts do I use to implement this in Xcode? 1. Do I use a View controller, add a View and embed a TableView and a Toolbar inside that view? 2. Do I use a Table View Controller and add a Table View inside it and use the bottom tool bar that comes with the table view?
In the Table View Programming Guide for iOS , under 'Recommendations for Creating and Configuring Table Views,' it says 'Use an instance of a subclass of UITableViewController to create and manage a table view.' When I use this, the bottom bar can only be fixed or disappear when going back and forth between two screens via segue. That makes me wonder whether I should just use a View controller which is against the recommendation.
Use a UIViewController
If you are going to display more than a tableView
then it is recommended to use a UIViewController
for the storyboard.
UIViewController
are much more flexible. I guess your confusion comes from the following documentation line:
Use an instance of a subclass of UITableViewController to create and manage a table view
This does not mean you must to drag and drop a UITableViewController
on the storyboard. It means your class need to inherit from UITableViewController
or at least implement the deleguate
and datasource
methods.
You would use UITableViewController
only and only if you need to display a tableView
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.