Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

blue-lion

macrumors member
Original poster
Jan 26, 2010
50
0
Hi, Ive got a question about UIView.

I don't understand how the series of UIView commands (below) know which view to refer to?.

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
pickerContainerView.frame= CGRectMake(0, 600, 320, 304);
[UIView commitAnimations];
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
Global variables. Something like this:

First method -> globalAnimationStarted = YES
Second method -> globalAnimationDuration = 0.3
Third method -> if (globalAnimationStarted == YES) add my change to the existing global animation
Fourth method -> Start the global animation

Undoubtedly it's more complicated than that but that's the basic idea. If animations can be nested then there's probably a stack of animation objects. These methods push/pop animation objects on/off the stack. But this is the basic idea.

BTW, those methods shouldn't be used anymore. Use the block based animation methods instead.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.