Instance Method


Registers a nib object containing a header or footer with the table view under a specified identifier.


func register(_ nib: UINib?, forHeaderFooterViewReuseIdentifier identifier: String)



A nib object that specifies the nib file to use to create the header or footer view. This parameter cannot be nil.


The reuse identifier for the header or footer view. This parameter must not be nil and must not be an empty string.


Before dequeueing any header or footer views, call this method or the register(_:forHeaderFooterViewReuseIdentifier:) method to tell the table view how to create new instances of your views. If a view of the specified type is not currently in a reuse queue, the table view uses the provided information to create a new one automatically.

If you previously registered a class or nib file with the same reuse identifier, the nib you specify in the nib parameter replaces the old entry. You may specify nil for nib if you want to unregister the nib from the specified reuse identifier.

See Also

Recycling Section Headers and Footers

func register(AnyClass?, forHeaderFooterViewReuseIdentifier: String)

Registers a class for use in creating new table header or footer views.

func dequeueReusableHeaderFooterView(withIdentifier: String) -> UITableViewHeaderFooterView?

Returns a reusable header or footer view located by its identifier.