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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:28:11+00:00 2026-06-06T01:28:11+00:00

I am trying to animate the blinking between two images on an imageview to

  • 0

I am trying to animate the blinking between two images on an imageview to draw the user’s attention to an indicator to noticing the change. I would like the image to only blink one or two times before remaining on the new image. The timeline of events would be something like the following:

  1. Old image has been set and is waiting for a particular event to occur.
  2. Event occurs and blinking animation begins. New image is displayed for 0.25 seconds.
  3. Old image is displayed for 0.25 seconds.
  4. New image is displayed for 0.25 seconds. Animation ends.

Due to the short timeframe of the animation I was under the impression that there was a way to do this without using a NSTimer. My current attempt is below

+(void)blinkImage:(UIImageView*)view toNewImage:(UIImage*)newImage numOfTimes:(int)numOfTimes{

    float waitInterval = 0.25;
    float totalWaitTime = 0.0;
    UIImage *oldImage = view.image;

    view.image = newImage;
    totalWaitTime = totalWaitTime+waitInterval;

    for (int times = 0; times<numOfTimes; times++) {
        [UIView beginAnimations:@"setOld" context:nil];
        [UIView setAnimationDelay:totalWaitTime];
        [UIView setAnimationDuration:waitInterval];
        view.image = oldImage;
        totalWaitTime = totalWaitTime+waitInterval;
        NSLog(@"SetOld; waitTime %f", totalWaitTime);
        [UIView commitAnimations];

        [UIView beginAnimations:@"setNew" context:nil];
        [UIView setAnimationDelay:totalWaitTime];
        [UIView setAnimationDuration:waitInterval];
        view.image = newImage;
        totalWaitTime = totalWaitTime+waitInterval;
        NSLog(@"SetNew; waitTime %f", totalWaitTime);
        [UIView commitAnimations];
    }
}

However, this did not yield the expected results. With the above code, the view simply changed to the new image and did nothing more.

Any help would be greatly appreciated. Thanks in advance!

  • 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-06T01:28:12+00:00Added an answer on June 6, 2026 at 1:28 am

    here put this one line bellow setAnimationDuration

    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:yourView cache:YES];
    

    here different type of Animation..
    also you can use bellow another way for animation

    #define kAnimationKey @"transitionViewAnimation"
    
    CATransition *animation = [CATransition animation];
        [animation setDelegate:self];   
        [animation setType:kCATransitionFromBottom];
        [animation setDuration:1.0];
        [animation setTimingFunction:[CAMediaTimingFunction functionWithName:
                                      kCAMediaTimingFunctionEaseInEaseOut]];
        [[yourView layer] addAnimation:animation forKey:kAnimationKey];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to animate two images moving across the screen using Monotouch. I've been
I'm trying to animate a logo. The markup looks like this: <div id=logo> <h1>
I'm trying to animate a waterfall of divs like in duitang.com . i tried
I'm trying to animate part of UI in an iPad app when the user
I am trying to animate a div when the user click the button. Each
I'm trying to animate object. I use keyframe animation: I have two vertex buffers
I'm trying to animate the change of the cornerRadius of a UIView instance layer
I'm trying to animate a series of full screen images. Each image will be
I'm trying to animate the removal of a tree node. As I move between
I'm trying to make a fancy blinking icon and animate the brush of a

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.