1. 程式人生 > >點贊動畫+1

點贊動畫+1

/**
 *  點選事件處呼叫該方法
 */
- (void)animation {
    CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
    animation.values = @[@1.5 ,@0.8, @1.0,@1.2,@1.0];
    animation.duration = 0.5;
    animation.calculationMode = kCAAnimationCubic;
    [self.點選按鈕.layer addAnimation:animation forKey:@"transform.scale"];
    [self.label2.layer addAnimation:animation forKey:@"transform.scale"];
}