响应链(六)

API中的响应链:

UIView:

@property(nonatomic,getter=isUserInteractionEnabled) BOOL userInteractionEnabled;  // default is YES. if set to NO, user events (touch, keys) are ignored and removed from the event queue.

userInteractionEnabled默认是YES,如果设置为NO,用户事件会被忽略,从事件队列中移除;

UIControl:

- (void)addTarget:(nullableid)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents;

target

The target object—that is, the object whose action method is called. If you specify nil, UIKit searches the responder chain for an object that responds to the specified action message and delivers the message to that object.

包含action对象的target对象。target对的action方法会被调用。 如果你指定了target为nil,UIKit会搜寻响应链中一个响应指定action信息的对象,传递这个消息给这个对象。

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 8,097评论 0赞 10
  • The Inner Game of Tennis W Timothy Gallwey Jonathan Cape ...
    网事_79a3阅读 13,253评论 3赞 20
  • 你问我 我的名字 我却用你的名字 与你相识 你的眼睛看向我 但却不是看我 而是看我身后的风景 我总在看你 看你奔跑...
    sssssssusie阅读 256评论 0赞 0
  • Bxbxbxb
    小饭桌创业课堂阅读 447评论 0赞 0
  • 文|张三先生 太阳落山,天有些阴沉,台风要来了,手机里收到政府发来的短信,已经第三次,来到这座城市三个月,一个月一...
    王二___阅读 1,150评论 5赞 8

友情链接更多精彩内容