1
CAKeyframeAnimation을 사용하여 앱에서 거의 애니메이션을 수행하지 않습니다. 나는 애니메이션과 함께 (때로는 그리고 때로는) 오디오 파일을 재생하고 싶다. 이것을 어떻게 할 수 있습니까? CAKeyframeAnimation 용 AnimationDidStopSelector가 있습니까? 아니면이 작업을 수행하는 다른 방법이 있습니까?CAKeyframeAnimation 및 오디오 동기화
UIBezierPath *movePath = [UIBezierPath bezierPath];
[movePath moveToPoint:imageAnimation.center];
[movePath addQuadCurveToPoint:CGPointMake(839, 339)
controlPoint:CGPointMake(671, 316)];
CAKeyframeAnimation *moveAnim = [CAKeyframeAnimation animationWithKeyPath:@"position"];
moveAnim.path = movePath.CGPath;
CAAnimationGroup *animGroup = [CAAnimationGroup animation];
animGroup.animations = [NSArray arrayWithObjects:moveAnim, nil];
animGroup.duration = 0.5;
imageAnimation.layer.position = CGPointMake(839, 339);
imageAnimation.tag = 0;
[imageAnimation.layer addAnimation:animGroup forKey:nil];
break;
감사 바르 토스를 구현합니다. '[imageAnimation.layer addAnimation : animGroup forKey : nil] 다음에 animationDidStop : 메소드를 명시 적으로 호출해야합니까? '? – Alex
아니요, 애니메이션이 중지되면 자동으로 호출됩니다. –
CA 그룹 애니메이션이 여러 개있는 경우 animationDidStop : 메소드 내에 어떻게 조건문을 사용할 수 있습니까? – Alex