Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6606789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:25:59+00:00 2026-05-25T19:25:59+00:00

I am using CAKeyframeAnimation to perform few animations in my app. I would like

  • 0

I am using CAKeyframeAnimation to perform few animations in my app. I would like to play an audio file (sometimes during and sometimes after) along with the animations. How can I achieve this? Is there a AnimationDidStopSelector for CAKeyframeAnimation or is there another approach for doing this?

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;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:26:00+00:00Added an answer on May 25, 2026 at 7:26 pm

    Actually there is. First assign yourself as delegate:

    animGroup.delegate = self
    

    If you want to use different animations you can use KVC to differentiate between them:

    [yourAnimation setValue:@"firstAnimation" forKey:@"animationName"];
    

    Then implement this method

    - (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag
    {
        if (flag && [[anim valueForKey:@"animationName"] isEqualToString:@"firstAnimation"]) {
            //play your sound
        }
        else if (flag && [[anim valueForKey:@"animationName"] isEqualToString:@"secondAnimation"]) {
            //do something else
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a CAKeyframeAnimation to animate a view along a CGPath. When the animation
Using Rails 3.2.0 with haml and sass: I Would like to link an external
I am animating a UIView along a circle using a CAKeyframeAnimation that follows a
Currently i am moving a png image using CAKeyframeAnimation along a path for 30
I'm animating a UIView's frame property using a CAKeyframeAnimation on the view's CALayer and
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using the HTML5 File API I can get the Binary String representation of a
I have a UIView instance that I am animating using CAKeyframeAnimation . It is
I'm having this problem with a CAKeyframeAnimation. After animating the layer of a UIView,
using xmltextreader, how would I load a hashtable. XML: <base><user name=john>2342343</user><user name=mark>239099393</user></base> This was

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.