Sequential Animations
Hello,
I have an array of UIButtons, which I want to animate onto the screen one by one.
When I loop through the array and call the animation function, which simply transforms and changes the center position of the button, all the buttons get animated together.
I want the animation to run for one button at a time, and then go on to the next button in the array.
Does anyone know why this is happening, or what the solution to this problem could be?
Thanks,
avidgamer101
I have an array of UIButtons, which I want to animate onto the screen one by one.
When I loop through the array and call the animation function, which simply transforms and changes the center position of the button, all the buttons get animated together.
I want the animation to run for one button at a time, and then go on to the next button in the array.
Does anyone know why this is happening, or what the solution to this problem could be?
Thanks,
avidgamer101
Possibly stating the obvious, but you are including a delay each time you invoke an animation aren't you? Could your buttons message a controller once they are in position (i.e. the animation has finished), and the controller then can fire off the next animation?
I am setting a delay to be the same amount of the time as the animation. Intuitively, this would finish the first one before starting off the second.
However, i am in a for loop, so I think the compiler is going through the loop, putting the executable animations into a single thread and executing it.
I have tried looping the animations through a completion block, but that is no good as well.
Any suggestions??
However, i am in a for loop, so I think the compiler is going through the loop, putting the executable animations into a single thread and executing it.
I have tried looping the animations through a completion block, but that is no good as well.
Any suggestions??
In that case, in the for loop, make the delay the cumulative sum of the previous delays. If the first delay is 0.5s, the second should 1s, the third 1.5s, etc.
The loop will be executed so quickly that the animations will all appear to happen at the same time.
The loop will be executed so quickly that the animations will all appear to happen at the same time.
that is working!
thanks a ton!!
thanks a ton!!
Great!
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Slightly more complex animations through UIView Animations | avidgamer101 | 8 | 2,214 |
Feb 12, 2013 10:39 AM Last Post: SethWillits |
|

