aryaxt / iOS-Slide-Menu

iOS Slide Menu with ability to add both left and right menu, and built in gesture recognizer. Similar to Path and Facebook
Other
1.52k stars 359 forks source link

How to set up this SlideMenu with multi storyboards and nav-controllers? #60

Closed ArthurMav closed 10 years ago

ArthurMav commented 10 years ago

How to set up this SlideMenu when I have multi storyboards and each storyboards has a navigation controller?

vialyx commented 10 years ago

You need to replace each UINavigationController on SlideNavigationController.

Manikandan-Rajamani commented 10 years ago

yup

-MANIKANDAN RAJAMANI

On Mon, Jul 21, 2014 at 3:23 PM, Maksim Vialykh notifications@github.com wrote:

You need to replace each UINavigationController on SlideNavigationController.

Reply to this email directly or view it on GitHub https://github.com/aryaxt/iOS-Slide-Menu/issues/60#issuecomment-49588286 .

ArthurMav commented 10 years ago

Can anyone give an example of how to do this? I set each UINavigationController's class to SlideNavigationController, but got problem on pop to other view controllers. Thanks

aryaxt commented 10 years ago

You shouldn't use multiple SlideNavigationcontrollers. You can have multiple storyboards, and still use a single SlidenavigationController. What is it you are trying to achieve?

ArthurMav commented 10 years ago

I am using this SlideMenu for my app's function navigation. Since I need to cooperate with my partner, I divided the storyboard by functions. I got a main storyboard which is the app's entrance. And every storyboard starts with a navigation controller, because I need to push and edit nav bar items for other view controllers embedded in it.

And then the problem comes, I tried to set the NavigationController of my main storyboard to SlideNavigationController, but failed, and also tried to set each NavigationController in all my storyboards to SlideNavigationController, but failed when switch to other ViewControllers.

What's the solution for this kind of problems?

aryaxt commented 10 years ago

The problem is SlideNavigationController is a singleton object, which means only one instance should exist. I think there are 3 choices

1- Fork and modify the code so that it's not longer a singleton, that way you could have as many instances as you want without any problem 2- Write code to push ViewControllers in the stack 3- Maybe try a single SlideNavigationController, which is the main SldieMenu, and for each storyboard have a main UINavigationControlelr which is what you navigate to when switching between viewControllers in the SlideNavigationController