Anna Yelizarova
Anna Yelizarova

Reputation: 46

How to include slide out menu on every page IOS (remove back button)

I am making a ios app which has a slide out menu. I followed the following tutorial: http://www.appcoda.com/ios-programming-sidebar-navigation-menu/ without too much trouble.

However something I was left asking myself was how to include to navigation menu on every page of my application. What I mean by this is that if my menu takes me to a page, from there how would I make a link to a new page which will still have the menu. At the moment I see a back button at the top left.

Most tutorials I found stop there. I have a different controller for every page in my menu. And I use reveal view controller.

Upvotes: 1

Views: 864

Answers (1)

Mrunal
Mrunal

Reputation: 14128

  • You would require a RootViewController which will have that top left button and other than that, entire screen will act as a container box. (empty view, let say UIView containerView)
  • Add a subview in that view as per your requirement let say if you have 3 buttons in Menu then initially you should load view1 by default.
  • If user selects 2nd option, then first remove all the views inside the containerView
for (UIView *subview in containerView.subviews)
{

   [suview removeFromSuperView];
}

// then, add your new selected view
[containerView addSubView: view2];

References:

Hope you have got what I am trying to convey.

Upvotes: 1

Related Questions