OliveappChinUpLayer.m 638 B

1234567891011121314151617181920212223
  1. //
  2. // OliveappChinUpLayer.m
  3. // AppSampleYitu
  4. //
  5. // Created by Xiaoyang Lin on 17/2/8.
  6. // Copyright © 2017年 Oliveapp. All rights reserved.
  7. //
  8. #import "OliveappChinUpLayer.h"
  9. @implementation OliveappChinUpLayer
  10. - (void)animationWithDuration: (CGFloat) duration {
  11. CABasicAnimation * animation = [CABasicAnimation animationWithKeyPath:@"opacity"];
  12. animation.fromValue = [NSNumber numberWithFloat:1.0f];
  13. animation.toValue = [NSNumber numberWithFloat:0.f];
  14. animation.duration = duration;
  15. animation.autoreverses = YES;
  16. animation.repeatCount = INFINITY;
  17. [self addAnimation:animation forKey:nil];
  18. }
  19. @end