UIResponder

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链断了 手动接上可以让出来的黄色也能响应点击事件了。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • ViewsBecause view objects are the main way your applicati...
    梁光飞阅读 3,870评论 0 0
  • 一. Hit-Testing 什么是Hit-Testing?对于触摸事件, window首先会尝试将事件交给事件触...
    面糊阅读 4,472评论 0 50
  • 响应链的构成 app中,视图都是按照树状结构组织起来的,构成树状结构的同时也构成了响应链。 找到第一响应者的过程 ...
    crazyfox阅读 2,720评论 0 1
  • angular指令通信 [图片上传失败...(image-6747d9-1535602100766)]
    codeTao阅读 2,224评论 0 1
  • 傅真人阅读 819评论 4 1