Posted By

sag333ar on 11/17/10


Tagged

UIView


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

sag333ar
bucko
Tintenklecks
cnathan
Rakesh


Flip animation in UIView


 / Published in: Objective C
 

  1. -(IBAction)btnBuyTapped:(id)sender{
  2. lblBuy.hidden=imgVBuy.hidden=btnBuy.hidden=YES;
  3. btnMinus.hidden=btnPlus.hidden=lblQty.hidden=NO;
  4. lblQty.text=@"1";
  5. [self animationCode:YES];
  6. }
  7.  
  8. // the main code for flip - from left/Right.
  9.  
  10. -(void)animationCode:(BOOL)boolVal{
  11. CGContextRef context = UIGraphicsGetCurrentContext();
  12. [UIView beginAnimations:nil context:context];
  13.  
  14. [UIView setAnimationTransition:(boolVal)?UIViewAnimationTransitionFlipFromLeft:UIViewAnimationTransitionFlipFromRight forView:vAnimation cache:YES];
  15. [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
  16. [UIView setAnimationDuration:0.25];
  17. [UIView commitAnimations];
  18. }

Report this snippet  

You need to login to post a comment.