UIResponder

2017-05-01  本文已影响0人  事件_666

1 nextResponder 响应链的下个响应者 上官网文档吧

class does not store or set the next responder automatically, so this method returns nil
by default. Subclasses must override this method and return an appropriate next responder. For example, UIView
implements this method and returns the [UIViewController
]or its superview (if it doesn’t). [UIViewController
] similarly implements the method and returns its view’s superview. UIWindow
returns the application object. UIApplication
returns nil。
2 isFirstResponder 是不是当前接收事件的View(textField textView)
3 becomeFirstResponder 通过判断view.window 判断是否可以执行吃方法。
4 canResignFirstResponder

Simulator Screen Shot 2017年5月11日 下午2.59.37.png

在绿色外面黄色里面touch链断了 手动接上可以让出来的黄色也能响应点击事件了。

上一篇下一篇

猜你喜欢

热点阅读