Transition between two NavigationControllers with ECSlidingViewController

208 views Asked by At

I am trying to accomplish something like this:

My Setup is this:

I have a Storyboard Setup with the SlidingViewController as the RootViewController. The Left Panel is acting as the Navigation Menu. From this Menu, I have Segues to different NavigationControllersenter image description here

What I want to do:

I want to transition between different NavigationControllers without 'loosing' the SidePanel. For an example: A User wants to add a product to the cart, but is not signed in - It should take them to the "Account Creation"-Navigation Controller.

How I am doing it right now:

[self.slidingViewController setTopViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"accountSetup"]];

This works, kinda. It changes the top navigation controller - but it does it instantaneously. Is there a way how I could animate this (like it is available for Segues?)

Thank you!

1

There are 1 answers

0
Nick Terry On

I would add custom animation code to the SlidingVC method. You'll probably want to add a bool and check that before running the anim code.

 { 
CGRect topViewFrame = _topViewController ? _topViewController.view.frame : self.view.bounds; 
if (myBOOL) { 
    //my custom anim code
 } 
[self removeTopViewSnapshot]; 
[_topViewController.view removeFromSuperview]; 
[_topViewController willMoveToParentViewController:nil]; 
[_topViewController removeFromParentViewController]; 

_topViewController = theTopViewController; 

Don't forget to reset your bool.