正如iOS 事件处理指南中提到的,当您创建自己的 UIView 子类时:
所有处理触摸的视图都希望收到完整的触摸事件流,因此在创建子类时,请记住以下规则:
- If your custom responder is a subclass of UIView or UIViewController, you should implement all of the event handling methods.
- If you subclass any other responder class, you can have a null implementation for some of the event methods.
**- In all methods, be sure to call the superclass implementation of the method.**
但是,在指南的“处理多点触控事件的最佳实践”部分中,它还说:
如果您在 UIView、UIViewController 或 UIResponder 的子类中处理事件:
- Implement all of the event handling methods, even if your implementations of those methods do nothing.
**- Do not call the superclass implementation of the methods.**
如果您在任何其他 UIKit 响应程序类的子类中处理事件:
- You do not have to implement all of the event handling methods.
**- In the methods you do implement, be sure to call the superclass implementation. For example, [super touchesBegan:touches withEvent:event].**
这是我的问题,我应该调用超类实现[super touchesBegan:touches withEvent:event]
吗?