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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:54:26+00:00 2026-06-09T13:54:26+00:00

just started to use Obj C for iOS, I was trying to animate all

  • 0

just started to use Obj C for iOS, I was trying to animate all the views (UIImageView) inside my subviews, but when I set the delay time to less than 1 second, the animation would animate all views at once. If i set the delay to 1 second or more, it will be animate correctly but the second animation will only start after the first one completes. I want to animate all those views back to back for example view number 1 would start animating, before it completes, the second should start to animate.

Here are my code.

-(void)animate
{
    int delaytime = 0.3; //first view will start after 0.3 secs

    for(UIView *view in self.subviews)
    {
        view.alpha = 0; //set it to transparent
        delaytime += 1 ; //couldn't get the desired effect when it is less than 1
        [UIView animateWithDuration:0.3
                              delay:delaytime
                            options: UIViewAnimationOptionTransitionNone
                         animations:^{
                             view.alpha = 1;       // fade in             }
                         completion:^(BOOL finished){
                             NSLog(@"Complete");
                         }]; 
    }
}
  • 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-06-09T13:54:28+00:00Added an answer on June 9, 2026 at 1:54 pm

    Your delay variable is an int and is therefore always rounded down to the integer value (0.3 becomes 0 and even 0.9999 becomes 0). This is the reason why all “delays” less than one second starts immediately for you, an int variable can’t hold decimal values.

    You should instead us the correct type NSTimeInterval

    NSTimeInterval delaytime = 0.3;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started to use doxygen and may not be familiar with all available
I just started to use the PHP symfony framework. Currently I'm trying to create
I've just started to use PHPUnit, but I've run into a bit of a
I just started to use PHP Simple HTML DOM Parser . Now I'm trying
I'm in this situation: First of all I just started to use mercurial. I've
I just started trying to use the minimax/negamax algorithm and I came up with
I just started a new iOS project and chose to use Core Data with
I just started learning how to use Task in C#. But I've encountered a
I've just started to use Greasemonkey and am trying to make a userscript that
I just started to use Liferay and I want to develop a portlet using

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.