Asks the delegate for a view object to display in the header of the specified section of the table view.
SDKs
- iOS 2.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- UIKit
Declaration
- (UIView *)tableView:(UITable View *)tableView viewForHeaderInSection:(NSInteger)section;
Parameters
tableViewThe table-view object asking for the view object.
sectionThe index number of the section containing the header view.
Return Value
The view object to display at the top of the specified section
Discussion
Use this method to return a UILabel, UIImage, or custom view for your header. If you implement this method, you must also implement the table method to specify the height of your custom view.