Dev
Dev

Reputation: 3945

popViewController with pushViewController animation

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

Upvotes: 0

Views: 869

Answers (3)

Hardik Vyas
Hardik Vyas

Reputation: 2253

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];

Upvotes: 1

NiravPatel
NiravPatel

Reputation: 3260

[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!!!!

Upvotes: 0

user529543
user529543

Reputation:

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!

Upvotes: 1

Related Questions