【发布时间】:2016-03-03 18:29:27
【问题描述】:
我正在尝试在 coreplot 中执行多个动画。 运行我用过的第一个动画:
[CPTAnimation animate:plotSpace
property:@"xRange"
fromPlotRange:oldXrange
toPlotRange:newxRange
duration:1.0
withDelay:0
animationCurve:CPTAnimationCurveCubicInOut
delegate:self];
并实现CPTAnimationDelegate:
-(void)animationDidFinish:(nonnull CPTAnimationOperation *)operation {
CPTPlotRange *newxRange = [CPTPlotRange
plotRangeWithLocation:@500
length:@100];
[self performSecondAnimationWithnewXRange:newXrange];}
但是,我想使用标识符运行多个动画。我尝试过创建 PTAnimationOperation,但不知道如何触发它:
CPTAnimationOperation* animation1 = [[CPTAnimationOperation alloc] init];
CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartPlotRange:plotSpace.xRange
endPlotRange:newxRange
duration:3.0
withDelay:0.0];
animation1.identifier = @"animation1ID";
animation1.period = period;
我如何实际启动动画,以便在委托中检查它的 ID?
【问题讨论】: