我想获取索引时点击UITableView
标题。现在,我没有添加UIGestureRecognizer
到标题那样:通过索引攻丝UITableViewHeader
- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(sectionTapped:)];
UIView *headerView = [UIView new];
headerView.backgroundColor = [UIColor grayColor];
[headerView addGestureRecognizer:recognizer];
// return [self.myTableView headerWithTitle:self.headers[section] totalRows:self.cells.count inSection:section];
return headerView;
}
-(IBAction)sectionTapped:(id)sender{
NSLog(@"tapped header");
}
是否有简便的方式来传递部分Index
上自来水?
是你的隔宿ture is works –