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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:00:22+00:00 2026-05-26T15:00:22+00:00

Similar to SO question ref: Why does UIView:animateWithDuration complete immediately? however, my code is

  • 0

Similar to SO question ref: Why does UIView:animateWithDuration complete immediately? however, my code is using [UIView beginAnimation], etc.

I have essentially this:

[UIView beginAnimation ...];
[UIView setAnimationDelay: 0.0];
[UIView setAnimationDuration: 1.25];
animatedImage.transform = "scale-up transform";

[UIView setAnimationDelay: 1.25]
[UIView setAnimationDuration: 0.50];
animatedImage.transform = "scale-down transform";

[UIView commitAnimation];

The image immediately jumps to the scale-up size, then 1.25 seconds later it animates nicely to the “scale-down” size. If I chain more sequences, they all work correctly, except the first one.

  • 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-26T15:00:23+00:00Added an answer on May 26, 2026 at 3:00 pm

    When you put animations in the same beginAnimation zone, they’ll animate at the same time.

    By calling [UIView setAnimationDelay: 1.25], you’re only overwriting your earlier [UIView setAnimationDelay: 0.0].

    So what happens, is that the UIView is told to scale both up and down simultaneously. I guess since you tell it to scale both up and down, it simply skips the to the last of the animations, but you did tell it to scale up, so it does that without animating.

    I suggest using the block syntax in stead, it allows you to do things after an animation completes:

    [UIView animateWithDuration:1.25
                     animations:^{animatedImage.transform = "scale-up transform";}
                     completion:^(BOOL finished)
                     {
                         [UIView animateWithDuration:1.25
                                          animations:^{animatedImage.transform = "scale-down transform";}
                         ];
                     }
     ];
    

    The code in the completion block (the ^{code} constructions are called ‘blocks’) is what happens after the first animation. You can keep chaining this for as many animations as you like.

    (BOOL finished) is a parameter passed along with the block. It tells if the animation was really finished. If NO, your animation was interrupted.

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

Sidebar

Related Questions

Similar question to, Does it make sense to have multiple tomcat instances on the
This question was inspired by a similar question: How does delete[] know the size
Similar question from last night, I don't have access to edit the source HTML
Similar question: Using Silverlight for an entire website? That question is over 2 years
Despite similar question was asked , I have differnet situation: My app consists mostly
Similar question here but this is slightly different... I have two tables that I
Ref URL; http://en.wikipedia.org/wiki/Future_value Earlier similar question; calculate Future value in iPhone Like we hvae
Previous question which links onto this and has any addition code ref should I
Similar question as this one but for a Microsoft Environment. Email --> Exchange Server
Similar question , but for Oracle. Why would I not always want to choose

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.