How would I add this feature programmatically? I'm not sure what I would search to find this. I know how to add the IBAction but not the code to generate this feature highlighted in the picture. Is it a custom cell or a divider?s
Header and footer views are optional, and you can customize them as much or as little as you want. To create a basic header or footer with a text label, override the tableView(_:titleForHeaderInSection:) or tableView(_:titleForFooterInSection:) method of your table's data source object.
If you want to have table view header along with section headers you have to set UITableViewStyle property to UITableViewStyleGrouped . Show activity on this post. If you have a single header in the table then you can use tableHeaderView as below: tableView.
A reusable view that you place at the top or bottom of a table section to display additional information for that section.
That's just a header in the TableView, they appear on top of your section
Use this method if you want a title:
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
Or this one if you want a custom view:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
And for the height:
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With