iphone: transition between views


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.