I have a UITableView with multiple sections. Each section has a section header (a custom view) is there an easy way to detect when someone selects the section header? (Just like didSelectRowAtIndexPath, but for the header?)
I have a UITableView with multiple sections. Each section has a section header (a
Share
No there is no way to do it with the
UITableViewDelegate.What you can do is to add a button the size of the section header view and add it to the view. Set the tag of the button to the section index.
Then just add the
UIViewControlleras a target for theUIControlEventTouchUpInside.Then by looking at the tag of the button you can see which section is clicked.