iOS Official document translation-create a Table View (Swift)

Source: Internet
Author: User

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.