0

I want to popViewController with pushViewController animation. Is there any way to do this? Is it possible?

Dev
  • 3,885
  • 10
  • 39
  • 65

3 Answers3

1

with a trick you can :)

get the viewcontroller which want to be visible after pop.

pop 2x without animation

push the targetviewcontroller animated, and you have the controller and the push animation :)

I hope it helps!

1

Working 100 %

list=[[List_ViewController alloc]initWithNibName:@"List_ViewControlleripad" bundle:nil]; CATransition *transition = [CATransition animation]; transition.duration = 0.45; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; transition.type = kCATransitionFromLeft; [transition setType:kCATransitionMoveIn]; transition.subtype = kCATransitionFromLeft; transition.delegate = self; [self.navigationController.view.layer addAnimation:transition forKey:nil]; self.navigationController.navigationBarHidden = NO; [self.navigationController pushViewController:list animated:NO];

Hardik Vyas
  • 1,973
  • 1
  • 20
  • 43
0
[UIView beginAnimations:nil context:nil];
 TargetViewCointroller *obj = [[TargetViewCointroller alloc]initWithNibName:@"TargetViewCointroller" bundle:nil];
  [self.navigationController pushViewController:obj animated:YES];

   [UIView setAnimationDuration:1.0];
    [UIView setAnimationBeginsFromCurrentState:YES];
     [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];
    [UIView commitAnimations];
     [obj_ release];

let me know is it working or not... Happy Coding!!!!

NiravPatel
  • 3,260
  • 2
  • 21
  • 31
  • I want the push animation while poping ... I dont want to allocate the TargetViewCointroller again – Dev Nov 22 '12 at 12:06