Instance Method

tableView(_:heightForFooterInSection:)

Asks the delegate for the height to use for the footer of a particular section.

Declaration

optional func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat

Parameters

tableView

The table-view object requesting this information.

section

An index number identifying a section of tableView .

Return Value

A nonnegative floating-point value that specifies the height (in points) of the footer for section.

Discussion

Use this method to specify the height of custom header views returned by your tableView(_:viewForFooterInSection:) method.

Special Considerations

Prior to iOS 5.0, table views would automatically resize the heights of footers to 0 for sections where tableView(_:viewForFooterInSection:) returned a nil view. In iOS 5.0 and later, you must return the actual height for each section footer in this method.

See Also

Providing Header, Footer, and Row Heights

func tableView(UITableView, heightForRowAt: IndexPath) -> CGFloat

Asks the delegate for the height to use for a row in a specified location.

func tableView(UITableView, heightForHeaderInSection: Int) -> CGFloat

Asks the delegate for the height to use for the header of a particular section.

class let automaticDimension: CGFloat

A constant representing the default value for a given dimension.