Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adopting a side menu in iOS app. View controllers structure issue

I'm designing an app intended to have the following navigation structure: I need to have a welcome view with "Sign up" and "Sign in" buttons as most of apps have:

iPhone_welcome

This view does not show any navigation bar, as it seems to be the common thing. If "Sign In" tapped, then the login view will be presented modally:

iPhone_signIn

And if "Sign up" tapped, the welcome view navigates to a form requesting user input to create an account:

iPhone_signUp

Then, once the user logs in and enters the app, I'd want it to have side menus similar to Facebook, YouTube or Spotify:

iPhone_facebook

Being the central panel a UINavigationController. Left side panel I think it usually is an 'UIViewController'...

The point is, I don´t know what the rootViewController of my app should be, and what hierarchy of view controllers should I have. I've thought about a couple of possibilities:

1) Being the rootViewController an UINavigationController, push the welcome view hidding the navigation bar (is that possible?), presenting the "Sign In" view if needed or pushing the "Sign Up" view. Once the user has logged in, pop these views from the rootViewController, that is a UINavigationController, and then push in such navigation controller the custom view controller managing the side menu stuff.

2) Being the rootViewController the side menu custom view controller, and setting as its central panel an UINavigationController. Push there the welcome view and so on, without setting any view controller for the left/right panels, and then when user has logged in, pop those views from the central panel's UINavigationController, push there the corresponding view, and now setting the left/right panels

I hope I've explained myself. Maybe there is another and better approach to handle this scenario. Does somebody implemented an app like this? I need help with this issue, and also I'll appreciate being recommended a custom library/control providing the side menu stuff from someone who has used one and it is easy to use and customize. I know there are lots of them (MMDrawerController, JASidePanels, for example), but I'd like to have some opinions from people that had developed an app with one of them.

Note: I need to support iPad as well, and iOS 5+

Thanks a lot

like image 414
AppsDev Avatar asked Jul 17 '13 15:07

AppsDev


3 Answers

I would recommend you to have two main ViewControllers, one for login/signup and second one for the main content with side menu. After the user will log in, just change the window rootViewController to the second one.

For the side menu you can use:

  • JTRevealSidebar for iOS
  • GSSlideMenu
  • JASidePanels
  • MMDrawerController
like image 168
Vojtech Vrbka Avatar answered Oct 22 '22 05:10

Vojtech Vrbka


I've design an app using ECSlidingViewController (created by Michael Enriquez) which works very fine for me and easy to use.

Tutorial also available on youtube : http://www.youtube.com/watch?v=tJJMyzdB9uI

like image 1
zbMax Avatar answered Oct 22 '22 06:10

zbMax


As for Swift, you could use InteractiveSideMenu library as Side Menu. It's quite easy to implement and transition animation looks pretty smooth. It was a good find for my project.

like image 1
Olga Konoreva Avatar answered Oct 22 '22 05:10

Olga Konoreva