iphone - Event handling in subclass of UIView -


as guide event handling guide ios mentions, when create own subclass of uiview:

all views process touches expect receive full touch-event stream, when create subclass, keep in mind following rules:

 - if custom responder subclass of uiview or uiviewcontroller, should implement of event handling methods.   - if subclass other responder class, can have null implementation of event methods.   **- in methods, sure call superclass implementation of method.** 

however in "best practices handling multitouch events" part of guide, says:

if handle events in subclass of uiview, uiviewcontroller, or uiresponder:

 - implement of event handling methods, if implementations of methods nothing.   **- not call superclass implementation of methods.** 

if handle events in subclass of other uikit responder class:

 - not have implement of event handling methods.   **- in methods implement, sure call superclass implementation. example, [super touchesbegan:touches withevent:event].** 

here question, should call the super class implementation [super touchesbegan:touches withevent:event] or not?

if want absorb touch within subclassed view, should 'not' call super touches method. however, if want make view capable of passing touches next responder, can implement super touches method. hope makes clear.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

How to call a javascript function after the page loads with a chrome extension? -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -