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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:51:33+00:00 2026-05-26T21:51:33+00:00

I use a UIView animation to randomly animate 5 squares (UIButtons) around the screen.

  • 0

I use a UIView animation to randomly animate 5 squares (UIButtons) around the screen. Depending on a user selection, there are anywhere from 2 to 5 squares visible. When only 2 are visible, the other three’s hidden values get set to YES, so they are actually still animating (right?), they just aren’t visible. But when only 2 are visible, the animation is smooth, but when all five are visible, the animation gets choppy. I’m not really sure how to describe it, because the squares are still moving at the correct speed and moving to the correct points; the choppiness isn’t terrible, just bad enough to be noticeable. Is there any way to get rid of it? This is the code I use to animate the squares:

Edit: changed animations to block:

[UIView animateWithDuration:animationSpeed 
                              delay:0 
                            options:UIViewAnimationOptionCurveLinear 
                         animations:^{
                             view.center = destPoint;
                         }
                         completion:^(BOOL finished){
                             if([view isEqual:squareThree])
                                 [self moveBadGuys];
                         }
         ];

/*for(UIButton* button in squareArray) {
    if(!shouldMove)
        return;

    [UIView beginAnimations:@"b" context:nil];
    [UIView setAnimationDuration:animationSpeed];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
    view.center = destPoint;
    [UIView commitAnimations];
}*/

Edit: the view presenting this is the third in a stack of three UIViewController presented with

ViewController* controller = [[[ViewController alloc] init] autorelease];
[self presentModalViewController:controller animated:NO];

Does this way of presenting views eat up memory?

  • 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-26T21:51:34+00:00Added an answer on May 26, 2026 at 9:51 pm

    There are a few things that can cause this. It always comes down to how complex the content is. Also, simulator can be really bad about handling animation, so be sure you are testing on real hardware.

    Are there large images on the buttons? Are the buttons casting shadows? Those things can slow it down.

    Also- use block based animation. Not the old begin-commit methods.

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

Sidebar

Related Questions

I am starting to learn to use UIView animation. So I wrote the following
Is there any alternative to use like tag to property of UIView? The thing
I use the following code to animate a flip transition on a view: [UIView
I have a UIView that contains a couple UIButtons that I am animating from
I would like to use UIView's transitionFromView method to animate a view and catch
For example, I use the animation in landscape status, duration is 5.0s, from status
Any recommendations on what UIView to use on the iPhone to create a listed
If I use the following to add a UIView subclass in the subviews collection:
How can I use the default background image for a UIView?
'''use Jython''' import shutil print dir(shutil) There is no, shutil.move, how does one move

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.