Posted By

habib123 on 02/07/10


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

bobbym245
cnathan


View Animation


 / Published in: Objective C
 

  1. #import <QuartzCore/QuartzCore.h>
  2. {
  3. CATransition *transition = [CATransition animation];
  4. transition.duration = 0.75;
  5. transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
  6.  
  7. NSString *types[4] = {kCATransitionMoveIn, kCATransitionPush, kCATransitionReveal, kCATransitionFade};
  8. NSString *subtypes[4] = {kCATransitionFromLeft, kCATransitionFromRight, kCATransitionFromTop, kCATransitionFromBottom};
  9.  
  10. transition.type = types[3];
  11. transition.subtype = subtypes[1];
  12. transition.delegate = self;
  13.  
  14. [containerView.layer addAnimation:transition forKey:nil];
  15.  
  16. [view1 removeFromSuperview];
  17. [containerView addSubview:view2];
  18. }

Report this snippet  

You need to login to post a comment.