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 216941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:36:41+00:00 2026-05-11T18:36:41+00:00

To phrase my question as simply as possible, is there a way to create

  • 0

To phrase my question as simply as possible, is there a way to create a core animation sequence to repeat over and over until a stop?

Specifically, I’m making a custom class that I want to have a -start and -stop method that will cause it to pulsate. Writing the animation code for the pulse is not the problem, rather, how to make it repetitive?

Thanks in advance for any answers!

  • 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-11T18:36:41+00:00Added an answer on May 11, 2026 at 6:36 pm

    According to the documentation, you do it by creating an animation with an extremely large repeatCount (code excerpted from the documentation I linked to):

    // create the animation that will handle the pulsing.
    CABasicAnimation* pulseAnimation = [CABasicAnimation animation];
    
    // over a one second duration, and run an infinite
    // number of times
    pulseAnimation.duration = 1.0;
    pulseAnimation.repeatCount = HUGE_VALF;
    
    // we want it to fade on, and fade off, so it needs to
    // automatically autoreverse.. this causes the intensity
    // input to go from 0 to 1 to 0
    pulseAnimation.autoreverses = YES;
    

    edit: The OP asked how to stop the animation. From the next paragraph in the documentation:

    You start an explicit animation by
    sending a addAnimation:forKey: message
    to the target layer, passing the
    animation and an identifier as
    parameters. Once added to the target
    layer the explicit animation will run
    until the animation completes, or it
    is removed from the layer. The
    identifier used to add an animation to
    a layer is also used to stop it by
    invoking removeAnimationForKey:. You
    can stop all animations for a layer by
    sending the layer a
    removeAllAnimations message.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not entirely sure how to phrase this question simply, so I will be
I'm not 100% certain how to phrase my question simply, so I apologize if
I wasn't 100% how to phrase this question. I have a request to a
I don't know how to phrase this question nor how to look it up
I can't quite think of how to phrase the question to be precise, but
I'm not even sure how I should phrase this question. I'm passing some CustomStruct
I'm so new to this that I can't even phrase the question right... Anyway,
Ok, I didn't really know how to even phrase the question, but let me
This question is hard to phrase, so I'm going to have to use some
Alright, hard to phrase an exact title for this question, but here goes... I

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.