美文网首页
响应链(六)

响应链(六)

作者: frankisbaby | 来源:发表于2018-12-21 16:32 被阅读14次

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信息的对象,传递这个消息给这个对象。

相关文章

网友评论

      本文标题:响应链(六)

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