OliveappChinLayer.m 845 B

12345678910111213141516171819202122232425
  1. //
  2. // OliveappChinLayer.m
  3. // AppSampleYitu
  4. //
  5. // Created by Xiaoyang Lin on 17/2/8.
  6. // Copyright © 2017年 Oliveapp. All rights reserved.
  7. //
  8. #import "OliveappChinLayer.h"
  9. @implementation OliveappChinLayer
  10. - (void)animationWithScale: (CGFloat) scale
  11. withDuration: (CGFloat) duration {
  12. CAKeyframeAnimation * animation = [CAKeyframeAnimation animation];
  13. animation.keyPath = @"transform";
  14. animation.values = @[
  15. [NSValue valueWithCATransform3D:CATransform3DMakeScale(scale, scale, 1)],
  16. [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.3, 1.3, 1)],
  17. [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.f, 1.f, 1)]
  18. ];
  19. animation.duration = duration;
  20. [self addAnimation:animation forKey:nil];
  21. }
  22. @end