Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. [self.navigationController pushViewController:viewController animated:YES];
  2.  
  3. UIViewController *newVC = ...;
  4. NSMutableArray *vcs = [NSMutableArray arrayWithArray:self.navigationController.viewControllers];
  5. [vcs insertObject:newVC atIndex:[vcs count]-1];
  6. [self.navigationController setViewControllers:vcs animated:NO];
  7. [self.navigationController popViewControllerAnimated:YES];
  8.  
  9. CATransition *transition = [CATransition animation];
  10. transition.duration = 0.45;
  11. transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault];
  12. transition.type = kCATransitionFromLeft;
  13. [transition setType:kCATransitionPush];
  14. transition.subtype = kCATransitionFromLeft;
  15. transition.delegate = self;
  16. [self.navigationController.view.layer addAnimation:transition forKey:nil];
  17.  
  18. self.navigationController.navigationBarHidden = NO;
  19. [self.navigationController pushViewController:pageView animated:NO];
  20.  
  21. [UIView beginAnimations:@"rightToLeft" context:NULL];
  22. CGRect newFrame = aView.frame;
  23. newFrame.origin.x -= newFrame.size.width;
  24. aView.frame = newFrame;
  25. [UIView commitAnimations];
  26.  
  27. CATransition *transition = [CATransition animation];
  28. transition.duration = 0.3f;
  29. transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
  30. transition.type = kCATransitionReveal;
  31. [self.navigationController.view.layer addAnimation:transition forKey:nil];
  32. [self.navigationController pushViewController:phoneServicesViewController animated:NO];
  33.  
  34. Try this :
  35. //Push effect in reverse way
  36. CATransition* transition = [CATransition animation];
  37. transition.duration = 0.75;
  38. transition.type = kCATransitionPush;
  39. transition.subtype = kCATransitionFromLeft;
  40. [self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
  41. [self.navigationController pushViewController:vc animated:NO];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement