Learn iOS and translate official documents to deepen your understanding and improve your English skills. English sucks, please understand if there is any mistake in translation.
Original address
How to create a TableView
In this lesson, you will create the main interface of the Foodtracker (demo app). You'll create a table view-based display of the user's food list, and complete the custom table cells to show the user's food per serving.
Learning Goals
After completing this course of robbery, you should:
Create a Storyboard scene
Understand the key components of table view
Create and design a custom table view cell
Understanding the role of delegate and data source in table view
Using arrays to store and consume data
Displaying dynamic Data in a table view
Create an initial scene
So far, Foodtracker already has a scene controlled by the view controller that allows users to add and comment on a meal record (the contents of the previous course), and it's time to add a scene that shows all the dining records. Fortunately, iOS provides a powerful built-in class (UITableView) that scrolls the presentation list data.
Each table view is derived from a Uiviewcontroller, which specializes in Table View Controller (Uitableviewcontroller) Management of Table view-related logic. You will create a new scene based on the table View controller.
Add a table view scene to your storyboard:
1. Open your storyboard,main.storyboard.
2. Open the Object library (select the View>utilities>show Object library in the menu bar, or open it directly using the cmd+option+0 shortcut)
3. In the object library, locate the table View Controller object (search in the lower right corner).
4. Drag a table View Controller from the list in the lower right corner, and then place it in the blank space of the storyboard.
If you drag a control that has a content display on the drag and then put it in the Storeboard blank, it doesn't really react, that probably you dragged the table view control instead of the table View controller control.
Now you have 2 scenes, one showing
iOS Official document translation-create a Table View (Swift)