UIResponder

来源:互联网 发布:安安电子狗软件 编辑:程序博客网 时间:2024/04/19 08:17

UIResponder定义了一个回应和操作事件的对象的接口。

有两个基本事件:触摸事件和移动事件(touch events and motion events)

Tasks

Managing the Responder Chain

  • – nextResponder
  • – isFirstResponder
  • – canBecomeFirstResponder
  • – becomeFirstResponder
  • – canResignFirstResponder
  • – resignFirstResponder

Managing Input Views

  •   inputView  property
  •   inputAccessoryView  property
  • – reloadInputViews

Responding to Touch Events

  • – touchesBegan:withEvent:
  • – touchesMoved:withEvent:
  • – touchesEnded:withEvent:
  • – touchesCancelled:withEvent:

Responding to Motion Events

  • – motionBegan:withEvent:
  • – motionEnded:withEvent:
  • – motionCancelled:withEvent:

Responding to Remote-Control Events

  • – remoteControlReceivedWithEvent:

Getting the Undo Manager

  •   undoManager  property

Validating Commands

  • – canPerformAction:withSender:

原创粉丝点击