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

  • Home
  • SEARCH
  • 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 7189085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:13:35+00:00 2026-05-28T19:13:35+00:00

How do you pause and resume UIView Animations? (without block animations) I was having

  • 0

How do you pause and resume UIView Animations? (without block animations)

I was having the hardest time figuring this out, so here is my source below on how to do it.

  • 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-28T19:13:36+00:00Added an answer on May 28, 2026 at 7:13 pm

    How to pause and resume UIView Animations:

    This will cover how to do the above without block animations. (People do still wish to support 3.0 and up).

    This only allows for pausing once the animation has met the set location. For how to pause an animation in the middle of an animation, i suggest using CALayers as such:

    CALayer* myLayer = [self.myUIView.layer presentationLayer];
    CGRect frameStop = myLayer.frame;
    double pausedX = frameStop.origin.x;
    double pausedY = frameStop.origin.y;
    

    Now for the actually how to:

    startAnimation = [UIButton buttonWithType:UIButtonTypeRoundedRect];
        startAnimation.titleLabel.font = [UIFont systemFontOfSize:22];
        startAnimation.titleLabel.lineBreakMode = UILineBreakModeHeadTruncation;
        [startAnimation setTitle:(@"pause") forState:UIControlStateNormal];
        [startAnimation addTarget:self action:@selector(doAnimation) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubview:startAnimation];
    
    
    
    -(void)doAnimation{
        if (bicyclePad.animationPause == false){
           [restartAnimation setTitle:(@"Resume") forState:UIControlStateNormal];
           [bicyclePad pauseAnimation];
        } else {
           [restartAnimation setTitle:(@"Pause") forState:UIControlStateNormal];
           [bicyclePad resumeAnimation];
        }
    }
    
    -(void)resumeAnimation{
        bicyclePad.animationPause = false;
        [restartAnimation setTitle:(@"Resume") forState:UIControlStateNormal];
        objectMotion = [[yourUIView alloc]initWithFrame:CGRectMake((*yourPathPoints)[0].x, (*yourPathPoints)[0].y, 8, 8)];
        [self.view addSubview:objectMotion];
        [self animateBike:nil finished:YES context:nil];
    
    
    }
    
    -(void)pauseAnimation{
       bicyclePad.animationPause = true;
    
       [restartAnimation setTitle:(@"Pause") forState:UIControlStateNormal];
       [bicyclePad doAnimation];
    }
    
    -(void)animateObject:(NSString*)animationID finished:(BOOL)finished context:(void*)context {
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationBeginsFromCurrentState:YES];
        //below suggesting your animation loops
        if (animationPause == true)
           [UIView setAnimationDidStopSelector:@selector(animateStop:finished:context:)];
        else
        [UIView setAnimationDidStopSelector:@selector(animateObject:finished:context:)];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationCurve: UIViewAnimationCurveLinear];
        [UIView setAnimationDuration:yourDelay];
        [UIView commitAnimations];
        animationPause == false;
    
    }
    
    -(void)animateStop:(NSString*)animationID finished:(BOOL)finished context:(void*)context{
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some difficulty figuring out the best ways to pause and resume my
In this code I want to Pause/Resume a thread using an AutoResetEvent and a
This is the solution I came up with to pause/resume an active thread inside
I trying to extend ConuntDownTimer to add the methods pause and resume in this
I'm having trouble in trying to pause and resume a JQuery.animated object, it pauses
I used he code below to handle pause and resume buttons in my game
This is probably a newbie question, but how can I pause and resume my
I have a button with 3 States Start/Resume/Pause. 1 Is this a good pattern
I need to pause for maybe 500 miliseconds before I submit a form. Here
how can i pause and resume in application while working with loops i can

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.