美文网首页
iOS事件传递

iOS事件传递

作者: 三三At你 | 来源:发表于2019-10-11 11:13 被阅读0次

    省略了部分系统事件

    事件
    hitTest-UIWindow
    pointInside-UIWindow
    pointInside-UIWindow YES
    hitTest-UIView
    pointInside-UIView
    pointInside-UIView YES
    hitTest-UIButton
    pointInside-UIButton
    pointInside-UIButton YES
    hitTest-UIButton UIButton
    hitTest-UIView UIButton
    hitTest-UIWindow UIButton

    响应
    UIButton
    UIView
    ViewController
    UIWindow
    UIApplication
    AppDelegate

    //hitTest伪代码
    :hitTest:view
      if pointInside(view) {
        for v in view.subView.reverse
          var rv = hitTest(v)
          if rv return v
      }
      return nil
    

    相关文章

      网友评论

          本文标题:iOS事件传递

          本文链接:https://www.haomeiwen.com/subject/afrtmctx.html