I have used a fairly common design pattern for a standard IOS slide out navigation. I based the design off of the example found here: http://www.raywenderlich.com/32054/how-to-create-a-slide-out-navigation-like-facebook-and-path. The basic design takes four view controllers, a center view controller, a left view controller, a right view controller and a main container view controller to hold and manage the three other views. The main container places the center controller on top and when the user slides his or thumb left or right, the view slides over to display the appropriate controller beneath. I recently adapted this to a project that has almost thirty different controllers. I have it working with the initial view but am wondering what is the best way to scale this feature? I want this slide-out navigation to be available on every single page so the user can just slide and navigate to anywhere at all times. The right and left view controllers will always be the same no matter what controller your on, is there a way to have a common main container that dynamically loads the center controller depending on the view the user is on? Or do I need to go and implement a container controller for every single controller I want to have the slide-out navigation functionality? Obviously I would think the first method would be the most efficient and scalable, but I have no idea how I could do that or if it is even possible.
Asked
Active
Viewed 6,493 times
4
-
1Well, if your center container was a navigation controller, you'd be ok. The main controller doesn't need to know anything about the content of the center controller – jrturton May 11 '13 at 21:24
-
1Check out https://github.com/mutualmobile/MMDrawerController – Matt G May 11 '13 at 21:29
-
Oh that's true I havn't ever thought about doing that. so I would have one navigation controller with a number of segues to all other controllers in the project? How would the navigation controller no where to go? @jrturton – ScottOBot May 12 '13 at 02:11
-
https://www.appcoda.com/sidebar-menu-swift/ find a good one, old, but still the same – sarah Oct 02 '18 at 02:50
1 Answers
3
An easy way to have a side slide out navigation is to intergrate opensource code into your project. The code normally comes with directions on how to implement it and a demo app.
Here is an example of an opensource slide nav like facebooks
The website this link takes you to (www.cocoacontrols.com) has some great opensource iOS controls as well!

Blancotech
- 145
- 6
-
3I am looking into open source and third party solutions for a lot of things that I do now and realy like the mfsidemenu. However, as I begin to develop for a company or organization a lot of them stray away from such solutions as having projects that are too dependant on them is a risk if the code becomes no longer supported in the next release of the apple development tools. A perfect example of this are the ASIHTTPRequest libraries. Also, call me a masochist but I enjoy actually creating my own solutions as they help me learn what's actually happening. @CodingJedi – ScottOBot May 14 '13 at 15:01