Instance Method

tableView(_:viewForFooterInSection:)

Asks the delegate for a view object to display in the footer of the specified section of the table view.

Declaration

optional func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView?

Parameters

tableView

The table-view object asking for the view object.

section

The index number of the section containing the footer view.

Return Value

The view object to display at the bottom of the specified section.

Discussion

Use this method to return a UILabel, UIImageView, or custom view for your footer. If you implement this method, you must also implement the tableView(_:heightForFooterInSection:) method to specify the height of your custom view.

See Also

Providing Custom Header and Footer Views

func tableView(UITableView, viewForHeaderInSection: Int) -> UIView?

Asks the delegate for a view object to display in the header of the specified section of the table view.

func tableView(UITableView, willDisplayHeaderView: UIView, forSection: Int)

Tells the delegate that the table is about to display the header view for the specified section.

func tableView(UITableView, willDisplayFooterView: UIView, forSection: Int)

Tells the delegate that the table is about to display the footer view for the specified section.