How does UIView nextResponder know what the UIViewController is?

后端 未结 4 671
旧时难觅i
旧时难觅i 2021-02-07 20:05

Just as a matter of curiosity, how does the nextResponder method implementation of the UIView class know who is the UIViewController that manages the view? The UIResponder docum

4条回答
  •  情书的邮戳
    2021-02-07 20:09

    If you look at UIView.h, you can see a member variable named _viewDelegate that is of type UIViewController*, this is probably where the view controller reference is stored when the viewcontroller's view property is set, and where it knows to look when you call nextResponder.

提交回复
热议问题