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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:00:16+00:00 2026-05-31T23:00:16+00:00

i am animating an UIImageView with an image of a circle that grows and

  • 0

i am animating an UIImageView with an image of a circle that grows and fades which repeats:

-(void)animateOuterCircle
{
    NSLog(@"animating circles");
    [UIView animateWithDuration:1.5 
                          delay:.5
                        options:(UIViewAnimationOptionAllowUserInteraction)
                     animations:^{
                         self.outerCircle.transform=CGAffineTransformMakeScale(.25, .25);
                     }
                     completion:nil];


    [UIView animateWithDuration:1.5 
                          delay:.5
                        options:(UIViewAnimationOptionRepeat | UIViewAnimationOptionAllowUserInteraction)
                     animations:^{    
                         self.outerCircle.transform=CGAffineTransformMakeScale(1.5, 1.5);
                         self.outerCircle.alpha = 0;
                     }
                     completion:nil];

    [self.view bringSubviewToFront:self.outerCircle];
}

i call this method in viewDidAppear:

- (void)viewDidAppear:(BOOL)animated
{        
    [self performSelectorOnMainThread:@selector(animateOuterCircle) withObject:nil waitUntilDone:NO];

    //other code
}

It will animate fine when i load mainView. the issue is i load view2 and dismiss view2, when i come back to mainView, it is not animating anymore.

any ideas why this is happening?

EDIT: the methods are being called:

2012-03-15 14:11:13.946[1529:17903] view2 canceled  //dismissing view2
2012-03-15 14:11:13.947[1529:17903] mapView viewWillAppear fired
2012-03-15 14:11:13.948[1529:17903] mapView viewWillAppear end
2012-03-15 14:11:14.352[1529:17903] mapView viewDidAppear fired
2012-03-15 14:11:14.353[1529:17903] animating circles
2012-03-15 14:11:14.354[1529:17903] mapView viewDidAppear end

EDIT 2:

-(IBAction) fourthBtn:(id)sender
{
    view2 *view2 = [self.storyboard instantiateViewControllerWithIdentifier:@"view2"];
    [self presentModalViewController:view2 animated:YES];    
}

dismissing view 2:

-(IBAction) cancel:(id) sender
{    
    NSLog(@"heir canceled");

    [self dismissModalViewControllerAnimated:YES];
}

also, i don’t stop the animation myself at any point in my code.

  • 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-31T23:00:17+00:00Added an answer on May 31, 2026 at 11:00 pm

    i re-did some code;

    -(void)viewWillDisappear:(BOOL)animated
    {
        [self.outerCircle removeFromSuperview];
        [self.innerCircle removeFromSuperview];
    }
    
    - (void)viewDidAppear:(BOOL)animated
    {
        self.innerCircle = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"inner-circle.png"]];
        self.innerCircle.frame = CGRectMake(self.innerCircle.frame.origin.x, self.innerCircle.frame.origin.y, 30, 30);
    
        self.outerCircle = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"outer-circle.png"]];
        self.outerCircle.frame = CGRectMake(self.outerCircle.frame.origin.x, self.outerCircle.frame.origin.y, 40, 40);
    
        [self.view insertSubview:self.innerCircle belowSubview:HUD];
        [self.view insertSubview:self.outerCircle belowSubview:HUD];
    
    //other code
    }
    

    with these changes, it behaves as i want it too.

    i think it had something to do with trying to animate the outerCircle a second time (it was already animating from first viewDidAppear, and when viewDidAppear was called a second time, it re-animated an already animating image and just borked it completely).

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

Sidebar

Related Questions

I am using a simple transformation animation to an UIIMageView. [UIView animateWithDuration:2 delay:0 options:UIViewAnimationOptionBeginFromCurrentState|UIViewAnimationOptionCurveEaseInOut
I have an array of images loaded into a UIImageView that I am animating
I am moving a UIImageView with the following animation: [UIView animateWithDuration:.5 delay:0 options:(UIViewAnimationCurveLinear |
i Have two images generated like this - (void)moveImage:(UIImageView *)image duration:(NSTimeInterval)duration curve:(int)curve x:(CGFloat)x y:(CGFloat)y
I have a UIImageView that I would like to change its image with animation.
animating with UIImageview takes the following steps create autoreleased UIImageView create array of image
We know that UIImageView has a very nice support for image sequence animation. We
I have a simple UIImageView with an image that is larger then the display
I want to pause UIImageView animation and based on my research found that you
I have a UIImageView object that when clicked it will play a animation, 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.