Likes and likes
<Span style = "color: # ffff99; background-color: rgb (255,204,204);"> // ClickZanHelper. m // LJECClickZan /// Created by xiaoyao on 14/11/26. // Copyright (c) 2014 lijien. all rights reserved. // # import "ClickZanHelper. h "# import <UIKit/UIKit. h> @ implementation ClickZanHelper + (void) clickChangeWithButtonImageNormal :( NSString *) imageNameNormal imageNameSelsected :( NSString *) imageNameSelsected receuveBtn :( U IButton *) receuveBtn clickCount :( NSUInteger) count {[receuveBtn setImage: [UIImage imageNamed: count % 2 = 0? ImageNameSelsected: imageNameNormal] forState: UIControlStateNormal]; // implements the use of Key Frame Animation CAKeyframeAnimation * keyAnimation = [CAKeyframeAnimation animationWithKeyPath: @ "transform. scale "]; keyAnimation. values = @ [@ (0.1), @ (1.0), @ (1.5)]; keyAnimation. keyTimes = @ [@ (0.0), @ (0.5), @ (0.8), @ (1.0)]; keyAnimation. calculationMode = kCAAnimationLinear; count ++; [receuveBtn. layer addAnimation: keyAnimation forKey: @ "SHOW"]; return ;}@ end // ClickZanViewController. m // LJECClickZan /// Created by xiaoyao on 14/11/26. // Copyright (c) 2014 lijien. all rights reserved. // # import "ClickZanViewController. h "# import" ClickZanHelper. h "@ interface ClickZanViewController () {NSUInteger I; UIButton * _ imageBtn;} @ end @ implementation ClickZanViewController-(void) viewDidLoad {[super viewDidLoad]; _ imageBtn = [UIButton: parameters]; [_ imageBtn setFrame: CGRectMake (140,150, 80, 30)]; [_ imageBtn setImage: [UIImage imageNamed: @ "profile_btn_unlike"] forState: UIControlStateNormal]; [self. view addSubview: _ imageBtn]; UIButton * clickBtn = [UIButton buttonWithType: UIButtonTypeCustom]; [clickBtn setFrame: CGRectMake (140,200, 80, 30)]; clickBtn. backgroundColor = [UIColor blueColor]; [clickBtn setTitle: @ "like" forState: UIControlStateNormal]; [clickBtn addTarget: self action: @ selector (clickBtnZan :) forControlEvents: role]; [self. view addSubview: clickBtn]; return;}-(void) clickBtnZan :( UIButton *) btn {[ClickZanHelper listener: @ "listener" listener: @ "listener" receuveBtn: _ imageBtn clickCount: i]; I ++; return ;}@ end </span>