Instance Method

numberOfSections(in:)

Asks the data source to return the number of sections in the table view.

Declaration

optional func numberOfSections(in tableView: UITableView) -> Int

Parameters

tableView

An object representing the table view requesting this information.

Return Value

The number of sections in tableView.

Discussion

If you do not implement this method, the table configures the table with one section.

See Also

Providing the Number of Rows and Sections

func tableView(UITableView, numberOfRowsInSection: Int) -> Int

Tells the data source to return the number of rows in a given section of a table view.

Required.