El método sectionHeaderTapped
debe tener uno de los siguientes firmas:
- (void)sectionHeaderTapped:(UITapGestureRecognizer *)sender;
- (void)sectionHeaderTapped;
Usted tiene que averiguar la celda que fue aprovechado usando las coordenadas del grifo.
-(void)sectionHeaderTapped:(UITapGestureRecognizer *)gestureRecognizer
{
CGPoint tapLocation = [gestureRecognizer locationInView:self.tableView];
NSIndexPath *tapIndexPath = [self.tableView indexPathForRowAtPoint:tapLocation];
UITableViewCell* tappedCell = [self.tableView cellForRowAtIndexPath:tapIndexPath];
}
Probablemente pueda obtener el encabezado de sección usando ese método. Pero puede ser más fácil asociar un reconocedor de gestos diferente a cada encabezado de sección.
- (UIView*)tableView:(UITableView*)tableView viewForHeaderInSection:(NSInteger)section
{
// ...
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(sectionHeaderTapped:)];
[headerView addGestureRecognizer:tapGesture];
return headerView;
}
Y luego
-(void)sectionHeaderTapped:(UITapGestureRecognizer *)gestureRecognizer
{
UIView *headerView = gestureRecognizer.view;
// ...
}
sí lo han utilizado diferentes gestos para cada sección, no es el mejor camino, pero forma más fácil ... Gracias –
prefecto respuesta .... gracias .. –