Posted By

BenClayton on 04/21/10


Tagged


Versions (?)

Who likes this?

13 people have marked this snippet as a favorite

avanadra
rvachere
clearbrian
umang_nine
sb
rubick
bucko
synced
andremariano
im3der
miamk
Tintenklecks
cnathan


iphone: transition between views


 / Published in: Objective C
 

  1. // get the view that's currently showing
  2. UIView *currentView = self.view;
  3. // get the the underlying UIWindow, or the view containing the current view view
  4. UIView *theWindow = [currentView superview];
  5.  
  6. // remove the current view and replace with myView1
  7. [currentView removeFromSuperview];
  8. [theWindow addSubview:view1];
  9.  
  10. // set up an animation for the transition between the views
  11. CATransition *animation = [CATransition animation];
  12. [animation setDuration:0.5];
  13. [animation setType:kCATransitionPush];
  14. [animation setSubtype:kCATransitionFromRight];
  15. [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
  16.  
  17. [[theWindow layer] addAnimation:animation forKey:@"SwitchToView1"];*/

Report this snippet  

You need to login to post a comment.