I am trying to have a UIViewController that appears with a slide animation on the right. Not like Push Segue, not a Facebook app. I want the new ViewController to move to the top of the current (without pushing it away), but only close the PART of the screen, leaving the other part showing the first ViewController.
What I tried: The closest I got is creating a custom segment with the following:
- (void)perform { __block UIViewController *src = (UIViewController *) self.sourceViewController; __block UIViewController *dst = (UIViewController *) self.destinationViewController; CATransition* transition = [CATransition animation]; transition.duration = .50; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; transition.type = kCATransitionMoveIn; transition.subtype = kCATransitionFromRight; [src.navigationController.view.layer addAnimation:transition forKey:@"SwitchToView1"]; [src.navigationController pushViewController:dst animated:NO]; }
This provides the animation I'm going to, but it covers the entire first ViewController. How can I stop it at a certain moment and not cover it all?
I use storyboards, and this is the first time I'm using a new animation.
ios uiviewcontroller storyboard segue uiviewanimation
Captjak
source share