Question

I've implemented a custom view for my UITableView section headers (via viewForHeaderInSection). When in plain view mode, the default behavior seems to be that the cells float underneath the section headers and touch events fall through to the cells underneath.

How can I have the custom section header view respond first to any touch events inside its bounds and take some action, rather than passing the event to the cell underneath the section header view?

Was it helpful?

Solution

Use an UIControl instead of an UIView with

[aControl addTarget:<target> action: @selector(<desiredSelector:>) forControlEvents:UIControlEventTouchUpInside];

OTHER TIPS

See http://developer.apple.com/library/ios/#samplecode/TableViewUpdates/Introduction/Intro.html It catch the tap events and perform action method. It may help you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top