Feroz Feroz - 2 months ago 11x
Objective-C Question

How to add image and title to header of table view IOS

In table view I have created header.

What is the correct way to set image or title in tableView's header? What I need to do?


Neo Neo

In the method

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section

you need to create a UIView and add other views like UIImageView(for image), UILabel(for title) and return the UIView at last.