Undocumented Animation Transitions!

Discussion in 'iOS Programming' started by Darkroom, Dec 12, 2009.

  1. Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #1
    am i the only person who didn't know about this?

    Code:
    #define NextPage 101
    #define PreviousPage 102
    #define Suck 103
    #define WaterRipple 110
    //There are a few others also (105, 106, 107, proabably more)
    
    @implementation TransitionEffectsViewController
    
    - (void)viewDidLoad
    	{
    	UIImageView *transitionView = [[UIImageView alloc] initWithFrame:CGRectMake(50, 100, 200, 300)];
    	transitionView.image = [UIImage imageNamed:@"parot2.jpg"];
    	transitionView.tag = 88;
    	[self.view addSubview:transitionView];
    	[transitionView release];
    	
    	UIButton *transitionButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    	[transitionButton addTarget:self action:@selector(animation) forControlEvents:UIControlEventTouchUpInside];
    	[transitionButton setTitle:@"Show Transition" forState:UIControlStateNormal];
    	[transitionButton setFrame:CGRectMake(10, 10, 200, 40)];
    	[self.view addSubview:transitionButton];
    	}
    
    - (void)animation
    	{
    	[UIView beginAnimations:nil context:NULL];
    	[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    	[UIView setAnimationDuration:1];
    	[UIView setAnimationTransition:NextPage forView:[self.view viewWithTag:88] cache:NO];
    	[UIView commitAnimations];
    	}
    	
    - (void)dealloc
    	{
    	[super dealloc];
    	}
    
    @end
    
     
  2. macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #2
    I never knew about them, but then I've only used the most basic of transitions in my apps thus far. Thus far my most complicated animation has been having a UIPickerView slide up from the bottom of the screen.
     
  3. thread starter Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #3
    it's too bad the animationTransition:110 is painfully slow when used for a UIImage, although i'm willing to bet it would function without delay on a vector based image.
     
  4. macrumors 6502a

    Joined:
    Nov 9, 2007
    #4
    Given these are undocumented and private you should not be using them in your apps if you plan on distributing them via the app store.
     

Share This Page