I've made a UIScrollView the first responder. I need to maintain touch events to a -touchesEnded:withEvent:
method on a view behind it. I've tried using the -nextResponder
method and that failed. I've tried forwarding -touchesEnded:withEvent:
to the view behind it and that fails.
How do I get this to work? The UIScrollView wont work unless it is the first responder or gets events some other way.
Thank you for any help. Shame Apple's documentation and APIs are terrible in areas.
UIScrollView
handles touches in a slightly unusual way. From the class reference:A subview within the scroll view's content view will eventually receive non-scrolling touches to the scroll view.
A superview of a scroll view is unlikely to see touch events as its
-hitTest:withEvent:
will return the scroll view so touch events will be sent to the scroll view which is not required to forward them back up the responder chain to the parent view.First responder does not influence the delivery of touch events, see http://developer.apple.com/library/ios/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/EventsiPhoneOS/EventsiPhoneOS.html#//apple_ref/doc/uid/TP40009541-CH2-SW5