0

when presenting:

CATransition *animation=[CATransition animation];
animation.delegate=self;
animation.duration=0.3;
animation.type=kCATransitionMoveIn;
animation.subtype=kCATransitionFromRight;

UIViewController13 *vc = [[UIViewController13 alloc] init];
[self presentViewController:vc animated:NO completion:nil];
[vc.view.layer addAnimation:animation forKey:@"animation"];

but I don't know how to customize the dismiss animation

kompozer
  • 2,094
  • 1
  • 11
  • 12
ziggear
  • 886
  • 7
  • 22
  • http://stackoverflow.com/questions/8956981/how-to-dismiss-a-modal-vc-with-fade-out-animation –  Aug 19 '13 at 08:35
  • i think you can't do this i face same probalam but i can't – Bug Aug 19 '13 at 08:49
  • When I was asking the same question I ended up using `UINavigationController` and not messing up with iOS default behaviour. There is a fundamental difference between a modal view and an ordinary one that's been pushed to the Navigation stack. Changing it seems quite alogical. – Sergey Grischyov Aug 19 '13 at 09:09
  • fade effect is easy, but push should be a different way @RanjuPatel – ziggear Aug 19 '13 at 10:47

1 Answers1

-1

Try to do it:

CATransition *animation=[CATransition animation];
animation.delegate=self;
animation.duration=0.3;
animation.type=kCATransitionMoveIn;
animation.subtype=kCATransitionFromRight;

UIViewController13 *vc = [[UIViewController13 alloc] init];

[self presentViewController:vc animated:NO completion:nil];
[self.view insertSubview:vc.view atIndex:0];  //line we add
[self.view.layer addAnimation:animation forKey:@"animation"]; //we edit
Kepler
  • 705
  • 1
  • 5
  • 19