2017-01-10 54 views

回答

5

可以拿到冠军与tableviewcell点击方法如下代码

UITableViewHeaderFooterView* header =[self.tableView headerViewForSection:indexPath.section]; 
NSLog(@"Header text = %@", header.textLabel.text); 

在斯威夫特

let sectionHeaderView = table.headerViewForSection(indexPath.section) 
let sectionTitle = sectionHeaderView?.textLabel?.text 
0

尝试以下获得冠军,如果您正在使用 “titleForHeaderInSection” 表委托:

func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { 

     let title = self.tableView(tableView, titleForHeaderInSection: indexPath.row) 

    } 
相关问题