@@ -331,21 +331,34 @@ - (CABasicAnimation *)rotationAnimation
331
331
return rotationAnimation;
332
332
}
333
333
334
- - (CABasicAnimation *)scaleAnimation
334
+ - (CAAnimationGroup *)scaleAnimation
335
335
{
336
336
// 眼皮和眼珠需要确定一个运动时间曲线
337
337
CABasicAnimation *scaleAnimation;
338
338
scaleAnimation = [CABasicAnimation animationWithKeyPath: @" transform" ];
339
339
scaleAnimation.fromValue = [NSValue valueWithCATransform3D: CATransform3DIdentity];
340
- scaleAnimation.toValue = [NSValue valueWithCATransform3D: CATransform3DMakeScale (1.0 , 2.5 , 1.0 )];
341
- scaleAnimation.duration = self.animationDuration ;
340
+ scaleAnimation.toValue = [NSValue valueWithCATransform3D: CATransform3DMakeScale (1.0 , 3.0 , 1.0 )];
341
+ scaleAnimation.duration = self.animationDuration * 0 . 75f ;
342
342
scaleAnimation.cumulative = YES ;
343
- scaleAnimation.repeatCount = HUGE_VALF ;
343
+ scaleAnimation.repeatCount = 1 ;
344
344
scaleAnimation.removedOnCompletion = NO ;
345
345
scaleAnimation.fillMode =kCAFillModeForwards ;
346
- scaleAnimation.autoreverses = YES ;
347
- scaleAnimation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseInEaseOut ];
348
- return scaleAnimation;
346
+ scaleAnimation.autoreverses = NO ;
347
+ scaleAnimation.timingFunction = [CAMediaTimingFunction functionWithControlPoints: 0.2 :0.0 :0.8 :1.0 ];
348
+ scaleAnimation.speed = 1 .0f ;
349
+ scaleAnimation.beginTime = self.animationDuration * 0 .25f ;
350
+
351
+
352
+ CAAnimationGroup *group = [CAAnimationGroup animation ];
353
+ group.duration = self.animationDuration ;
354
+ group.repeatCount = HUGE_VALF;
355
+ group.removedOnCompletion = NO ;
356
+ group.fillMode =kCAFillModeForwards ;
357
+ group.autoreverses = YES ;
358
+ group.timingFunction = [CAMediaTimingFunction functionWithControlPoints: 0.2 :0.0 :0.8 :1.0 ];
359
+
360
+ group.animations = [NSArray arrayWithObjects: scaleAnimation, nil ];
361
+ return group;
349
362
}
350
363
351
364
@end
0 commit comments