美文网首页
IOS学习(1)-UIButton

IOS学习(1)-UIButton

作者: deactivateuser | 来源:发表于2016-06-28 20:39 被阅读11次

    1. Why there use (id)sender in the button click event?

    (id)sender is the object which sent the message to that selector. It's like in the delegate functions where you have the control passed in to the function, etc.
    You'd use this if you had 2 objects which were calling that selector and you wanted to distinguish between them. Of course, you could just use two different functions, but it's often cleaner and less duplication of code to use one function.

    2. 取消点击效果

    button.adjustsImageWhenHighlighted = NO;

    相关文章

      网友评论

          本文标题:IOS学习(1)-UIButton

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