I have this in my table header view section:
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(sectionHeaderTapped:)];
I want to pass the section number in the method sectionHeaderTapped so i can recognize which section got tapped.
My method implementation looks like this:
-(void)sectionHeaderTapped:(NSInteger)sectionValue {
NSLog(@"the section header is tapped ");
}
How can I achieve this?
The method
sectionHeaderTappedshould have one of the following signatures:You have to figure out the cell that was tapped using the coordinates of the tap.
You can probably get the section header using that method. But it may be easier to attach a different gesture recognizer to each section header.
And then