Search code examples
iosuistoryboardsegueecslidingviewcontroller

Using ECSlidingViewController to change to a new storyboard


I am trying to split up my Storyboard as it has become painful to work with and I need to have some separation for organizational purposes.

I am using ECSlidingViewController as a main navigation menu. It has been working great. But now that I would like to segue to a new storyboard I am having difficulty.

I have tried a couple of methods.

  1. First I tried instantiating a new storyboard and UIViewController and then using presentViewController. This works but the animation effect from ECSlidingViewController is overwritten and I am unable to unwind back.
  2. I have also tried UIStoryboardSegue and subclass it. I then initialize it and call perform. This method gave me no results.

I feel I may need to create my own sliding navigation menu but I wanted to see if anyone has some helpful insight on this issue. Thanks for any help.


Solution

  • I would do it like this

    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"storyB" bundle:nil];
    self.slidingViewController.topViewController = [storyboard instantiateViewControllerWithIdentifier:@"storyboardId"];
    [self.slidingViewController resetTopViewAnimated:YES];