I am having a tableview which has several section. What I want is when I select a particular tableview cell from section I want title header of that section. I looked several SO question but didn't find out anything useful. Thanks in advance.
You can get title with following code on tableviewcell click method
UITableViewHeaderFooterView* header =[self.tableView headerViewForSection:indexPath.section];
NSLog(@"Header text = %@", header.textLabel.text);
In Swift
let sectionHeaderView = table.headerViewForSection(indexPath.section)
let sectionTitle = sectionHeaderView?.textLabel?.text
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