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

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -