How do Responder Chain Works in IPhone? What are the “next responders”?

后端 未结 5 1465
难免孤独
难免孤独 2021-01-31 09:01

This is what the documentation says:

If the first responder [to an event or action message] cannot handle an event or action message, it forwards it to th

5条回答
  •  离开以前
    2021-01-31 10:03

    From the docs for the nextResponder:

    The UIResponder class does not store or set the next responder automatically, instead returning nil by default. Subclasses must override this method to set the next responder. UIView implements this method by returning the UIViewController object that manages it (if it has one) or its superview (if it doesn’t); UIViewController implements the method by returning its view’s superview; UIWindow returns the application object, and UIApplication returns nil.

提交回复
热议问题