69 lines
2.5 KiB
Objective-C
69 lines
2.5 KiB
Objective-C
//
|
|
// YinGetPointGroup.m
|
|
// yinmeng-ios
|
|
//
|
|
// Created by yinmeng on 2024/3/23.
|
|
//
|
|
|
|
#import "YinGetPointGroup.h"
|
|
|
|
@implementation YinGetPointGroup
|
|
|
|
+ (CAAnimationGroup *)getGroupPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint centerPoint:(CGPoint)centerPoint{
|
|
|
|
CAKeyframeAnimation *animation0 = [CAKeyframeAnimation animation];
|
|
animation0.duration = 0.8;
|
|
animation0.keyPath = @"transform.scale";
|
|
animation0.values = @[@1.0,@1.5,@2.0,@1.5];
|
|
animation0.repeatCount = 1;
|
|
animation0.calculationMode = kCAAnimationCubic;
|
|
animation0.removedOnCompletion = NO;
|
|
animation0.fillMode = kCAFillModeForwards;
|
|
|
|
CAKeyframeAnimation *animation1 = [CAKeyframeAnimation animation];
|
|
animation1.duration = 0.8;
|
|
animation1.beginTime = 0.8;
|
|
animation1.keyPath = @"transform.scale";
|
|
animation1.values = @[@1.5,@2.0,@2.5,@3.0];
|
|
animation1.repeatCount = 1;
|
|
animation1.calculationMode = kCAAnimationCubic;
|
|
animation1.removedOnCompletion = NO;
|
|
animation1.fillMode = kCAFillModeForwards;
|
|
|
|
|
|
CAKeyframeAnimation *animation2 = [CAKeyframeAnimation animation];
|
|
animation2.duration = 0.8;
|
|
animation2.beginTime = 0.8;
|
|
animation2.keyPath = @"position";
|
|
animation2.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];;
|
|
animation2.values = @[[NSValue valueWithCGPoint:startPoint],[NSValue valueWithCGPoint:CGPointMake(centerPoint.x ,centerPoint.y)]];
|
|
animation2.repeatCount = 1;
|
|
animation2.removedOnCompletion = NO;
|
|
animation2.fillMode = kCAFillModeForwards;
|
|
|
|
CAKeyframeAnimation *animation3 = [CAKeyframeAnimation animation];
|
|
animation3.duration = 0.8;
|
|
animation3.beginTime = 2.6;
|
|
animation3.keyPath = @"transform.scale";
|
|
animation3.values = @[@3,@2.5,@2,@1.5,@1];
|
|
animation3.repeatCount = 1;
|
|
|
|
CAKeyframeAnimation *animation4 = [CAKeyframeAnimation animation];
|
|
animation4.duration = 0.8;
|
|
animation4.beginTime = 2.6;
|
|
animation4.keyPath = @"position";
|
|
animation4.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
|
|
animation4.values = @[[NSValue valueWithCGPoint:CGPointMake(centerPoint.x ,centerPoint.y)],[NSValue valueWithCGPoint:endPoint]];
|
|
animation4.repeatCount = 1;
|
|
|
|
CAAnimationGroup *group = [CAAnimationGroup animation];
|
|
group.duration = 3.2;
|
|
group.animations = @[animation0,animation1,animation2, animation3,animation4];
|
|
group.repeatCount = 1;
|
|
group.removedOnCompletion = NO;
|
|
group.fillMode = kCAFillModeForwards;
|
|
|
|
return group;
|
|
}
|
|
@end
|