How To Add a Slide-out Sidebar Menu in Your Apps

435 Flares 435 Flares ×

How can I create a slide-out sidebar menu in my app? This is one of the frequently asked questions we got from our readers. So this week we’ll show you how create a slide-out navigation menu similar to the one you find in the Facebook app.

For those who are unfamiliar with slide out navigation menu, Ken Yarmost gave a good explanation and defined it as follows:

Slide-out navigation consists of a panel that “slides out” from underneath the left or the right of the main content area, revealing a vertically independent scroll view that serves as the primary navigation for the application.

Since Facebook app introduced this slide-out sidebar design, it quickly becomes a standard way to implement navigation menu. You can easily find this design pattern in most of the popular content-related apps such as Path, Mailbox, Gmail, etc.

Slideout Navigation Menu Featured

The slide-out design pattern lets you build a navigation menu in your apps but without wasting the screen real estate. Normally, the navigation menu is hidden behind the front view. The menu can then be triggered by tapping a list button in the navigation bar. Once the menu is expanded and becomes visible, users can close it by using the list button or simply swiping left on the content area.

With so many free pre-built solution on GitHub, we’re not going to build the slide-out navigation menu from scratch. Instead, we’ll make use of a library called SWRevealViewController. Developed by John Lluch, this excellent library provides a quick and easy way to put up a slide-out navigation menu and it’s available for free.

Read on and develop a demo app together.

A Glance at the Demo App

As usual, we’ll build a demo app to show you how to apply the SWRevealViewController. The app is very simple but not fully functional. The primary purpose of the app is to walk you through the implementation of slide-out navigation menu. The navigation menu will work like this:

  • User triggers the menu by tapping the list button at the top-left of navigation bar.
  • User can also bring up the menu by swiping right on the main content area.
  • Once the menu appears, user can close it by tapping the list button again.
  • User can also close the menu by dragging left on the content area.
Slideout Menu Demo App

Slide-out Navigation Menu

Creating the Xcode Project

With a basic idea about what we’ll build, let’s move on. You can create the Xcode project from scratch and design the user interface similar to below:

Sidebar Demo App Storyboard

Storyboard of the Demo App

However, to save your time from setting up the project, you can download the Xcode project template to start with.

The project already comes with:

  • A pre-built storyboard with all the view controllers needed
  • A pre-built view controller classes including MapViewController and PhotoViewController
  • All icons and images needed for the app (credit: thanks for the free icon from Pixeden)

Importing the SWRevealViewController Library

As mentioned, we’ll use the free SWRevealViewController library to implement the slide-out menu. So, first download the library from GitHub and extract the zipped file.

After you extract the file, you should find “SWRevealViewController.h” and “SWRevealViewController.m”. Import both files into the Xcode project and put them under “Library”.

Import SWRevealViewController in Xcode

Import SWRevealViewController into Library

Associate the Front View and Rear View Controller

One of the beauties of the SWRevealViewController library is it provides the built-in support of Storyboard. Of course, if you prefer, you can also use Interface Builder to create the sidebar menu. But from what we know, most of you opt for Storyboard to design the user interface.

When implementing sidebar menu using SWRevealViewController, developers have to associate the SWRevealViewController with a front and a rear view controller using segues. The front view controller is the main controller for displaying content. In our storyboard, it’s the navigation controller which associates with another view controller for presenting news content. Apparently, the rear view controller is the controller for showing the navigation menu. Usually the menu is implemented by using UITableViewController.

SWRevealViewController Front Rear View

Front and Rear View of SWRevealViewController

If you’re using our Xcode template, we’ve pre-built the front and rear view controllers for you. What you have to do is to define segues between the SWRevealViewController and front/rear view controller.

First, select the empty UIViewController and change its class to “SWRevealViewController”.

SWRevealViewController in Storyboard

Changing the class to SWRevealViewController

Next, press and hold the control key. Click on the SWRevealViewController and drag it to the Sidebar view controller. After releasing the button, you’ll see a context menu for segue selection. In this case, select “reveal view controller”. This defines a custom segue by using “SWRevealViewControllerSegue”.

Repeat the same procedures to connect SWRevealViewController with the navigation controller.

SWRevealViewController Connects Front Rear View

Defining Segues for SWRevealViewController

Select the segue between SWRevealViewController and the navigation controller. In the attributes inspector, set the segue identifier to “sw_front”. This is the default identifier to indicate a transition of front view controller.

For the segue between SWRevealViewController and the sidebar view controller, set the segue identifier to “sw_rear”. This identifier tells SWRevealViewController that the controller represents the rear view (i.e. the sidebar menu).

Storyboard Segue sw_rear

Setting the segue identifier for front and rear view controllers

If you compile and run the app, you’ll see an app displaying the “News Frontpage”. But that’s it. You won’t see the sidebar menu when tapping the list button. We haven’t implemented the action method yet.

Open “MainViewController.m”, which is the controller class of “News Frontpage”. Add the following import statement:

1
#import "SWRevealViewController.h"

Next, add the following code in the viewDidLoad method:

1
2
3
4
5
6
7
8
9
    // Change button color
    _sidebarButton.tintColor = [UIColor colorWithWhite:0.96f alpha:0.2f];

    // Set the side bar button action. When it's tapped, it'll show up the sidebar.
    _sidebarButton.target = self.revealViewController;
    _sidebarButton.action = @selector(revealToggle:);

    // Set the gesture
    [self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];

We first change the list button color and then assign the list button with an action. The SWRevealViewController provides a “revealToggle:” method to handle the expansion and contraction of the sidebar menu. Lastly, we also add a gesture recognizer. Not only you can use the list button to bring out the sidebar menu, user can swipe the content area to activate the sidebar.

Try to compile and run the app. Tap the list button and the sidebar menu will be appeared. Tap the button again to close it. You can also swipe right on the content area to open the menu.

Empty Slide Out Navigation Menu

Before moving on, add the same code snippet to both PhotoViewController.m and MapViewController.m.

Adding the Menu Items in Navigation Menu

With just a few lines of code, you already implement the slide-out navigation menu. Cool, right?

However, the menu is now empty. We’ll now add a few items and show you the transition from one item to another. The sidebar view controller is just a simple table view controller. For sake of simplicity, we’ll design the sidebar menu right in the storyboard.

The first table cell is defined with the title of our website. If you don’t like it, just change it to whatever you prefer. Just make sure you keep the cell identifier as “title”, which we’ll refer it in our code.

Okay, let’s add a few more menu items. To begin, select the prototype cell and change the number of prototype cells to “8″ in the attributes inspector. You should end up with a screenshot similar to below:

Sidebar Menu Prototype Cells

Changing the number of prototype cells

Change the “APPCODA” label of the second cell to “News”. Optionally, you can change the color of label to light gray and set the font to “Helvetica Light” in the attributes inspector. Next, drag a image view object from the object library to the cell. Set the size of image view to 38×38 and change the image to “news.png”.

Next, select the cell and set the cell identifer as “news” in the attributes inspector. You should end up with a cell similar to the below screenshot:

Sidebar Menu News Items

News cell item with news identifier

Repeat the above procedures to add the following menu items:

  • Comments (set the images as comments.png and cell identifier as comments)
  • Map (set the images as map.png and cell identifier as map)
  • Calendar (set the images as calendar.png and cell identifier as calendar)
  • Wishlist (set the images as wishlist.png and cell identifier as wishlist)
  • Bookmark (set the images as bookmark.png and cell identifier as bookmark)
  • Tag (set the images as tag.png and cell identifier as tag)

If you’ve done everything correct, your menu should look like this:

Sidebar Menu with Menu Item

After completing the user interface, let’s go back to the code. Select the “SidebarViewController.m” and import the following header files:

1
2
#import "SWRevealViewController.h"
#import "PhotoViewController.h"

Next, declare the following property to store the cell identifier of the menu items:

1
@property (nonatomic, strong) NSArray *menuItems;

In the viewDidLoad method, add the following code:

1
2
3
4
5
    self.view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:1.0f];
    self.tableView.backgroundColor = [UIColor colorWithWhite:0.2f alpha:1.0f];
    self.tableView.separatorColor = [UIColor colorWithWhite:0.15f alpha:0.2f];
   
    _menuItems = @[@"title", @"news", @"comments", @"map", @"calendar", @"wishlist", @"bookmark", @"tag"];

The above code is very straightforward. We first set the background color of the view and table view and initialize the menu item array with the values of cell identifier.

Then change the number of rows from 0 to [self.menuItems count]. Your code should look like this:

1
2
3
4
5
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    return [self.menuItems count];
}

Lastly, change the “cellForRowAtIndexPath” method to the following. The code simply gets the cell identifier of the specified table cell from the menuItems array for display.

1
2
3
4
5
6
7
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *CellIdentifier = [self.menuItems objectAtIndex:indexPath.row];
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
   
    return cell;
}

Now compile and run the app again. Tap the list button and you’ll find a slide-out navigation menu with a much better design.

Slideout navigation menu with better design

Implementing Menu Item Selection

You’ve already built a visually appealing sidebar menu. However, there is still one thing left. As of now, we haven’t defined any segues for the menu item. When you select any of the menu items, it won’t transit to the corresponding view.

To make the demo app simple, we’ll only connect the menu item with three view controllers. We think this should give a pretty good demonstration to show you how it works. Here are what we’re going to do:

  • Connect the “News” cell item with the main view controller using a reveal view controller segue
  • Connect the “Map” cell with the map view controller using a reveal view controller segue
  • For the rest of the menu items, they will be associated with the photo view controller using the same type of segue. But we’ll display different photos for different menu items.

Okay, go back to storyboard. First, select the map cell. Press and hold the control key and click on the map cell. Drag to the map view controller. Select the “reveal view controller” segue when prompted.

Sidebar menu item connection

Connecting the map item with map view controller

Repeat the above procedure for the “News” cell item, but connect it with the main view controller.

For the rest of menu items including comments, calendar, wishlist, bookmark and tag, connect them one by one with the photo view controller and set the segue identifier as “showPhoto”. We’ll use this identifier to differentiate the segue from the previous two we created.

showPhoto segue

Defining showPhoto as the segue identifier

Open the “SidebarViewController.m”, add the “prepareForSegue” method to manage the transition.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
- (void) prepareForSegue: (UIStoryboardSegue *) segue sender: (id) sender
{
    // Set the title of navigation bar by using the menu items
    NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
    UINavigationController *destViewController = (UINavigationController*)segue.destinationViewController;
    destViewController.title = [[_menuItems objectAtIndex:indexPath.row] capitalizedString];
   
    // Set the photo if it navigates to the PhotoView
    if ([segue.identifier isEqualToString:@"showPhoto"]) {
        PhotoViewController *photoController = (PhotoViewController*)segue.destinationViewController;
        NSString *photoFilename = [NSString stringWithFormat:@"%@_photo.jpg", [_menuItems objectAtIndex:indexPath.row]];
        photoController.photoFilename = photoFilename;
    }
   
    if ( [segue isKindOfClass: [SWRevealViewControllerSegue class]] ) {
        SWRevealViewControllerSegue *swSegue = (SWRevealViewControllerSegue*) segue;
       
        swSegue.performBlock = ^(SWRevealViewControllerSegue* rvc_segue, UIViewController* svc, UIViewController* dvc) {
           
            UINavigationController* navController = (UINavigationController*)self.revealViewController.frontViewController;
            [navController setViewControllers: @[dvc] animated: NO ];
            [self.revealViewController setFrontViewPosition: FrontViewPositionLeft animated: YES];
        };
       
    }
   
}

Let us go through the above code line by line:

  • Line 4 to 6 are used to set the title of the navigation bar. We simply use the cell identifier as title.
  • Line 9 to 13 are only for those segues with “showPhoto” identifier. The photo view controller will only display a single photo. Here we set the file name of the photo to be displayed. Say, when user taps the “Comments” item, we’ll show the “comments_photo.jpg”.
  • Line 15 to 25 are the code to manage the view transition and tell SWRevealViewController the new front view controller for display. We reuse the navigation controller and replace the view controller with destination view controller.

Compile and Test the Final App

Now compile and test the app again. Open the sidebar menu and tap the map item. You’ll be brought to the map view. Try to test other menu items and see what you get.

Sidebar Demo App Map Item

Summary

In this tutorial, we show you how to apply SWRevealViewController to implement a slide-out navigation menu similar to the one in the Facebook app. If you do a search in GitHub, you can find other sidebar solutions such as GHSidebarNav and ViewDeck. You’re free to explore other libraries and see which is the best fit for your app. If you’d like to learn how to build the sidebar menu from scratch, Ray Wenderlich offers a great tutorial.

For your complete reference, you can download the full source code from here. As always, leave us comment and share your thought about the tutorial.

Update: The Xcode project has been updated. It’s now compatible with Xcode 5 and iOS 7. You can download the project from here.

You May Like These:

Get Free Chapters of Our AppCoda Book

Learn iOS 7 Programming from Scratch

The Learn iOS 7 Programming from Scratch is a 400-page eBook written for beginners with little or even no programming experience. It is based on the tutorials of our popular programming course. The book starts with the basics and walks you through the process to create iOS apps using iOS 7 SDK and Xcode 5. Want to learn more? Check it out here and get two free chapters.


Build Your Own Game and Monetize on the Side

Learn how to develop your first iOS game and make money on the side. The starter kit will come with full source code of a memory game for both iPhone and iPad, as well as, a complete guide to explain how the code works. Check out the starter kit to learn more.


  • napolux

    Awesome! I used the component in some previous project and it’s really easy to implement. Your tutorial covers the “lack” of a good example on the project site.

    Thanks!

  • Joseph

    Hey,
    Great tutorial, will this be able to work in iOS 7?

    • http://www.simonblog.com Simon Ng

      Not tested on iOS 7 yet, but I think it should work. Anyway, I’ll do a test on iOS 7 beta 2 later.

      • Moritz

        Hey, awesome work.
        I am a fan of this page for over six month.
        I didn’t get it working with iOS7 and XCode5. Had someone tried it and can share their experience?

      • bsoriano

        if ios7 works but when I add another navigationController I get error when invoking it from the tableviewcell, know how to fix this

      • Rick

        Does not work in iOS 7… Any plans on posting a comment on how to get it to work in iOS7? Someone said use UIViewController, drag a tableview, add some delegate and add some property… While this could be obvious for experts I think articles here are targeted at novice/intermediate devs… Would it be possible at all to update or post a comment detailing how to achieve that please?

  • macuser79

    Fantastic … I wanted a tutorial that would explain how to perform this type of implementation … Thanks a lot

    • http://www.simonblog.com Simon Ng

      Yes, the sidebar view controller is actually a UITableViewController. So you can render it dynamically using your own method.

      • macuser79

        Ok thanks……

  • vat

    URGENT: When I do all of the steps up to just getting the menu to show up, when I compile and run it says in the console “Unknow class SWRevealController in Interface Builder File”? Any help please. :(

    • http://www.simonblog.com Simon Ng

      Is it a typo? The class should be “SWRevealViewController” instead of “SWRevealController”.

    • Rod

      Hey, just select the SWRevealViewController.m class and then go to View > Utilities > Show File Inspector.
      Make sure your project is checked under Target Membership.

      • Gabriel

        What do you mean about Target Membership?

      • Gabriel

        ok i found it,thanks

    • Joel

      Had the same error and the solution for me was:
      1) Select your Project in the Sidebar
      2) Go to “Build Phases”
      3) Make sure SWRevealcontroller.m is listed in the “Compile Sources” list
      4) Build and Run

      • abc

        It’s still not working for me ? Any other suggestions ?

  • Ioannis

    great work as always!very glad i found this site a couple of months ago. still a newbie but helped me learn many many things:)keep up the good work!!

  • Rafael Avila

    Awesome tutorial, thank you so much!

  • Harish Geeth

    Hey, awesome tutorial. I like SWRevealViewController better than ECSlidingViewController. Very easy to use and less code. One question I have is,

    I have a LogInViewController -> NewsFeed. While authenticating user, I am sending some information to the NewsFeedViewController. How do I handle that type of situation ?

    Your thoughts are highly appreciated.

    Thank you.

  • pascal

    This is insanely great stuff that you guys are providing with each one of your posts – really appreciate this.

  • LittlePeculiar

    As always, well done. I love the little tricks I learn from your tutorials.
    Thanks

  • Ben Azoulay

    Urgent please how to add a sidebar button in navigationcontoller?????

    • http://www.simonblog.com Simon Ng

      In Storyboard, just drag a Bar Button Item from the Object library to the navigation bar to add the sidebar button.

      • Alaeddine Ghribi

        And what about adding a button into the NOT ROOT ViewController navigation bar?
        When opening a view controller from the side menu bar, I have automatically the navigation bar, but can’t add anything on it because it’s not present in the StoryBoard.

        • Ben Azoulay

          I have the same thing…..

          • Alaeddine Ghribi

            Okay, here is what I did right now, just hide the automatic navigation bar with: [self.navigationController setNavigationBarHidden:YES]; Then add a navigation bar from the storyboard and add buttons. Don’t forget to add [self.navigationController setNavigationBarHidden:NO]; in the root controller.

  • Alaeddine Ghribi

    Thank your for your tutorial. I’m facing a problem : when I tap on any element on the UITableView sidebar, nothing happens. The segue identifiers are pretty ready and configured. Any hints please?

  • Alaeddine Ghribi

    Can I add different (more than ONE) side bars for different view controllers?

  • Souhail Marghabi

    Hi, I enjoyed reading your tutorial. i would like to ask for help about the following problem: In my app, i have several view each displaying and doing something in core data, and for now my rootviewcontroller is a tableviewcontroller embedded in a nav and I wanted to know what are the changes i need to do in the rootviewcontroller or app delegate.m to add the sidebar visible in every view. My rootviewcontroller is implemented the same way as this : http://developer.apple.com/library/ios/#samplecode/CoreDataBooks/Introduction/Intro.html

  • Mark Crippen

    Hey, i have followed the tutorial correctly, however i keep getting a weird error

    0x22ab94d: calll 0x22ab952 ; CA::Layer::sublayers() + 14 Thread 1: EXC_BAD_ ACCESS(Code=2 Address=0xbf7fffec)

    I get this error whenever i click on the tableview to segue to a new Navigation Controller. what would cause this? how can i fix it?

    • Mark Crippen

      I fixed my own error. I had the Segue going to the Navigation Controller and not to the actual View Controller.

      • bsoriano

        when I add viewcontroller if it works but if I want to add another navigationController get the same errror, it came to solving

  • Max

    Hello, i have follow this great tutorial, but i have a question. I have a TableViewController with an NSArray and a view controller. I want all items of my table view opens my ViewController.

    Help please it’s urgent.

    Sorry for my bad english i’m french.

  • Jacob Klapper

    Thank you very much, this was very helpful! I have a question though: How do I render a cell in the table “unusable” or grayed out? Like let’s say I press on the tags cell, now I want that cell to be grayed out next time I open the menu, how do I do that?

    Thanks

  • ilikepear

    Tested it on iOS7 beta2.. indeed broken, so is many sidebarnav’s like GHSidebarNav

    Looks on simulator and device(ip4) as per below.. slightly different but still broken.

    • Guest

      where you able to resolve this for ios 7 beta

      • Gunnar

        A temporary fix: Add an image view on top of the table view and adjust the height of the image so it suits your needs.

      • joelypolly

        Proper fix is to put a view outside the UITableView and change the UITableViewController to a UIViewController and add UITableViewDataSource, UITableViewDelegate

    • hanmookwan

      Add image view – height 20

    • Guru

      can we implement for ipad?? with same swrevealviewcontroller

    • Rakari

      I found this on stack overflow: – (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{

      [cell setBackgroundColor:[UIColor colorWithWhite:0.2f alpha:1.0f]];

      } Just put it in the SidebarViewController.m

  • Jacob Klapper

    After completing this tutorial, if I try to add new cells to the tabelview, the height/width of the new label is unchangeable, any idea why?

  • Souhail Marghabi

    Can You do a tutorial on sidebar with one of the apps in your other tutorials that has views with functionalites rather than display?

  • Souhail Marghabi

    hi, Can you tell us what to do when we want to integrate this to an existing app?

    • saad maghrabi

      If the app doesn’t use Storyboard, just pick the sources SWRevealView, add them; then connect them to your project.

      • Souhail Marghabi

        And with an already existing storyboard? what do i need to change in the app.

  • benjones73

    When I drag the news or other image in to each cell after changing the label and font. It comes in huge and I am wondering how to resize it to the correct size.

    • Joel

      Did you insert it into an image view of the correct size?

  • asinox

    Great!, thank you

  • Pingback: Binary App Dev: Apps | iOS Slide-Out Sidebar Navigation Bar issue

  • Robert

    Great, tutorial.
    However how could I make this so the menu is on the right?

  • Pepper

    I’m trying to add state preservation & restore to this app. Since it only uses storyboards, from what I’ve found online, I should only need to implement methods and not set up a class:

    - (BOOL)application:(UIApplication *)application shouldSaveApplicationState:(NSCoder *)coder
    {
    return YES;
    }

    - (BOOL)application:(UIApplication *)application shouldRestoreApplicationState:(NSCoder *)coder
    {
    return YES;
    }

    in my app delegate and then set up a unique restoration id for every controller (including the reveal view controller & navigation controller). When this didn’t work, I then set up a unique restoration id for every table view and view in the storyboard as well. Still no luck. Any suggestions? Thanks!

  • Pingback: Code Answers » Adding State Preservation & Restoration to Code From Online Tutorial Using Storyboards Doesn’t Work

  • Joao Paulo

    Hello, great tutorial, many thanks for that.

    But, what if I have another ViewController as my initial view controller?

    I’ve got a logoViewController(Splash View) as my initial one.

    I tried to compile following the tutorial and I got:

    *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil’

    • Fibla

      I have the same problem. You found the solution?

      • Joao Paulo

        Nope, I tried a couple of other ways of doing a Slide Menu, but no success as well. I will give it a go again with this one and let you know.

  • Pingback: Creating a pop out menu without a nav bar button | BlogoSfera

  • Joel

    It would be really helpful if you’d have highlighted the “Before moving on, add the same code snippet to both PhotoViewController.m and MapViewController.m.”. I didn’t see it the first time when I’ve read the tutorial, otherwise great tutorial!

  • rgb

    great tutorial. simple question, i have a tab bar style app that i am converting to this (slide view) style menu, each tab is its own navigation controller and everything works fine. on conversion, how can i segue from the menu items to a new navigation controller? your tutorial re-uses the navigation replacing the original view controller with the destination view controller. thanks.

    • Jeremy Langer

      I was having this same issue. Here’s what I did to solve it:
      1. Give each navigation controller you want to be included in the menu a Storyboard ID (in the Identity inspector), such as “navTest”.
      2. Create a SWRevealViewControllerSegue from each row of the menu to its navigation controller. Give each segue a unique identifier, such as “showNavTest”.
      3. Go to the View Controller for your slide out menu and go to your prepareForSegue.

      - (void) prepareForSegue: (UIStoryboardSegue *) segue sender: (id) sender
      {
      // Make sure we are using the SWRevealViewControllerSegue
      if ( [segue isKindOfClass: [SWRevealViewControllerSegue class]] )
      {
      SWRevealViewControllerSegue *swSegue = (SWRevealViewControllerSegue*) segue;

      swSegue.performBlock = ^(SWRevealViewControllerSegue* rvc_segue, UIViewController* svc, UIViewController* dvc)
      {
      // The name of our view controller we want to navigate to
      NSString *vcName = @””;

      // Set the name of the Storyboard ID we want to switch to
      if ([segue.identifier isEqualToString:@"showNavTest"])
      {
      vcName = @”navTest”;
      }

      else if ([segue.identifier isEqualToString:@"showNavOtherTab"])
      {
      vcName = @”navOtherTab”;
      }

      // If we selected a menu item
      if (vcName.length > 0)
      {
      // Get the view controller
      UIViewController *vcNew = [[UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:NULL] instantiateViewControllerWithIdentifier:vcName];

      // Swap out the Front view controller and display
      [self.revealViewController setFrontViewController:vcNew];
      [self.revealViewController setFrontViewPosition: FrontViewPositionLeft animated: YES];
      }

      else
      {
      // Could not navigate to view – add logging
      }
      };
      }
      }

      • Jeremy Langer

        Here’s a screenshot for easy readability:

        • Ben Azoulay

          i have this issue: return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
          when i try this. please help

          • bsoriano

            excellent tutorial, I’m using it but when I want to add another navigationcontroller for a listing RSS, I get the same error … any other suggestions

          • Rakari

            You have probably messed up the connections in the storyboard or something. does’nt the error say something about SIGABRT?

        • bsoriano

          excellent tutorial, I’m using it but when I want to add another navigationcontroller for a listing RSS, I get the same error what Ben … any other suggestions

        • misato

          Hi Jeremy,
          I had the same issue but thanks to your tips, I got it to work. Thanks!

      • Ulix

        1.
        In the SidebarViewController the identity is SidebarController, bur “Use Storyboard ID” is uncheck
        Other Viewcontroller (eg PhotoViewController MapViewController….) need the same IDStoryboard (navtest) and Use Storyboard uncheck? and Restoration ID is not necessary?

        2.
        I have 20 rows in the sidebar menu, How and where should I set the SWRevealViewControllerSegue?

        3.
        in which ViewController i put the code? in each?

        thanks for the answers

    • Gavin Carter

      I simply made sure each view controller had the following coded into its .m file:

      // Set the side bar button action. When it’s tapped, it’ll show up the sidebar.

      _sidebarButton.target = self.revealViewController;

      _sidebarButton.action = @selector(revealToggle:);

      // Set the gesture

      [self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];

      Make sure that you also import the relevant .h file:

      #import “SWRevealViewController.h”

      Behold, back navigation from view controllers working fine! Everything you need above can be copied out of your MainViewController.m file

  • Infinite∞Development

    HELPPPP I got everything working but the

    // Set the gesture

    [self.view addGestureRecognizer:self.revealViewController.panGestureRec

    The error read ‘panGestureRec’ not found on object of type ‘SWRevealViewController*’ Any suggestions?

    • Nathaniel Lee

      Rec is a typo, its recognizer

  • Jennifer

    This is the worst tutorial I’ve ever used. The code just didn’t work and now I’ve wasted so much time trying to learn something that just didn’t work.

  • george

    HELP…. when i open a tab which isnt news, the bar button item goes blue in color and im not able to open the side nav anymore?

    • Rakari

      Same issue here

      • Rakari

        Found out! you just copy the lines _sidebarButton.target = self.revealViewController;

        _sidebarButton.action = @selector(revealToggle:); in the MainController
        to both MapViewController and PhotoViewController

  • Guest

    segue is going from slide out menu items to UIViewControllers.

    there come two options selection segue or accessory action

  • Usman Ahmad

    segue is not going to the UIViewController from slide out menu items.

    there are coming 2 options. 1 is segue action other is accessory option. check my attached image

    • Nathaniel Lee

      Do selection, reveal view controller

      • Usman Ahmad

        thanks buddy. it is solved.

  • John

    Nice Tutorial. helps me a lot :)

  • npersson

    Does this work on iOS 5 or 5.1?

  • Juan Luis

    Im not able to use it in ios7 beta 6, any suggestion?.it brokes when i write this line in viewDidLoad

    [self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];

    any suggestion? thanks.

  • Ludwig Paulsen

    I followed the tutorial step by step and get those errors on the last step any suggestions? (XCode 5 DP beta)

    In the prepareForSegue method the last paragraph (the transitions) causes several issues. “Use of undeclared identifier SWRevealViewControllerSegue”
    “Use of undeclared identifier “swSegue”, did you mean “segue”? and 13 other errors. :o

  • Nathaniel Lee

    I have a quick workaround for this on IOS 7,

    What you do is when you set up the sidebar controller, instead of dragging in a table view controller, you put a regular view controller and drag a table view into it. This allows you to resize the table view to accommodate the menu bar.

    In your code, all you have to do is add next to the interface declaration, and add a @property for the object, tableView

    Now with the dark gray color change, you have to do that in interface builder (at least thats how I did it)

  • Usman Ahmad

    worked. its awesome tutorial

    • shiva kumar

      what is the options and bars in xcode 4.X&4.x

  • Ulix

    The tutorial is very good, but I have 2 problems
    First problem: with Xcode 5 Beta (iOS7) the App work fine but the Menu Button is not visible
    Second problem: in this MapViewController I would like the map is opened with a specific address, and with the ability to create a route (with car) It’s possible?

    • Rakari

      Answer to first problem: comment out the line in MainViewController that says _sidebarButton.tintColor = [UIColor colorWithWhite:0.96f alpha:0.2f];

      Answer to second problem: Go into the mapViewController and watch this tutorial https://www.youtube.com/watch?v=fvj0ywGUM24 (sorry it’s xcode 4)

  • george

    Hi im new to app dev,

    how do i add pages to the demo app, what i want is about 8 of the main view controllers (just blank pages )with the sidebar icon at the top to make different pages in the app. I have tried to copy the code but all that comes back when i make a new file and paste the code is _sidebar error please help

  • bob

    can anyone make a video tutorial of how to put it all together including adding new pages!

  • Guest

    Ask how to fix error code …

  • hanmookwan

    Ask how to fix error code …’multiful segues wiht identifier showPhoto’

  • Emil Tinebo

    This is a really great tutorial. I downloaded your Xcode Project Template and followed the tutorial. Worked out fine. What I want to do now is that I want to change the background color of the navigation bar but I only manage to set the background color of the sidebarButton. Can anyone point me in the right direction of how to accomplish this?

    • Rakari

      go to the navigation controller and select the navigation bar and change the bar tint to whatever you want

  • hanmookwan

    created a new ViewController.

    Navigation Bar comes out abnormally. Please tell me what is the problem.

    -ViewController.m-

    #import “TagViewController.h”

    #import “SWRevealViewController.h”

    @interface TagViewController ()

    @end

    @implementation TagViewController

    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil

    {

    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];

    if (self) {

    // Custom initialization

    }

    return self;

    }

    - (void)viewDidLoad

    {

    [super viewDidLoad];

    _sidebarButton.target = self.revealViewController;

    _sidebarButton.action = @selector(revealToggle:);

    _sidebarButton.tintColor = [UIColor colorWithWhite:0.96f alpha:0.2f];

    }

    - (void)didReceiveMemoryWarning

    {

    [super didReceiveMemoryWarning];

    // Dispose of any resources that can be recreated.

    }

    @end

  • Paul

    So I can get the side menu to work properly on my first view controller called “view controller” in the image. However, I need to be able to load the first view controller (it loads necessary data for classmates view controller in the image i have provided), and then segue to my classmates view controller, and have that access the side menu. So the view controller should not have access to the side menu, but once I have segued into my classmates view controller, that should. I cannot seem to implement this, I think it has something to do with the reveal controller needing to be the initial view controller. I need my “view controller” to be the initial one, and the side menu to be accessible from my classmates view controller. Essentially, the first page is a login page, and doesnt need the side menu, until the user is logged in. Any ideas?

    • Chelsea

      You might have figured this out by now, but I thought I would go ahead and add in a comment just in case you haven’t or someone else needed the solution as well. All you would need to do in this case is set the login page as your root view controller, and instead of having a segue from that to you classmates view controller, simply have it segue to the SWRevealViewController which has the classmates view controller as it’s sw_front. I have a similar thing working on my app so it should work if I explained it correctly. =)

      • puneet

        hey…i tried that but its giving me a back button instead of my reveal icon, i tried hiding it from swreveal view controller but then it doesnt show me my reveal icon

  • Hossein

    Great tutorial really , thanks for that , i have a question , is there a way the menu open from right to left ?
    i mean reverse operation that in this tutorial say….in fact i want the menu button , go to the right of navigation control and the menu open from right , now it’s open from left in this tutorial… is there a way for this?

    • Diana Sutandie

      Open the .h file, they have provided some implementations for reversed version. You have to changed the sw_rear into sw_right as well.

    • Leo

      @selector(rightRevealToggle:);

  • Pingback: Calling a function from a button | QueryPost.com

  • Jerry Salazar

    hi, i have one problem, when i move to other View i lost the button back, and i want that show the button, ok thanks, great tutorial, but you do have a solution for this?

  • lavo20

    I followed the tutorial exactly and I get “Scene is unreachable due to lack of entry points and does not have an identifier for runtime access via -instantiate ViewControllerWithIdentifier:” Why is this?

  • hanmookwan

    Created a new ViewController.
    i don’t create navigation bar.
    – navigation bar + item (?) Does this create?
    I want to create a Navigation bar is known.

    • guest

      I guess you’re japanese ?

  • Benjamin Porter

    Great tutorial! Except when I run it there is a black bar on the top that I can’t seem to get rid of. Also when you slide down on the menu, a spinning wheel comes up and it wont go away. Any suggetions?

    • AnthonyMarchenko

      For make status bar white. Add two property to the .plist file

      UIStatusBarStyleLightContent (String) – UIStatusBarStyleLightContent

      View controller-based status bar appearance (bool) to NO

  • Jeromii UnReal Anderson

    i want to excuete this tutorial but by using XIB can somebody help me please.

  • VansFannel

    And, if we are not using Storyboards?

  • dan

    i get an error code when i try to open the sidebar menu. It stops the simmulator and brings up this code:
    @autoreleasepool {
    return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
    }
    thread 1: signal SIGABRT.

    • Rakari

      Then there’s something wrong connected in the storyboard

  • Milan Skrecek

    Great tut. But I couldn’t get it to work. Did anyone really get this slideout menu working for Xcode5? If so, it there a link to the final source files?

  • Brain

    Hello, it is a great tutorial and i used it to develop an app, but when i updated the ios7, the image of menu button was invisible. Could you help me solve this?Thanks a lot!

    • Diego Giuliani

      me too
      same problem

      • Bianca Araujo

        to fix this problem:

        comment out _sidebarButton.tintColor = [UIColor colorWithWhite:0.96f alpha:0.2f];

  • Sanchit Choubey

    excellent Demo…:) thanks..!!

  • Pingback: Add a Slide-Out Sidebar Menu in iOS Apps | Skills421

  • Pingback: IOS – trigger navigation within script | CopyQuery

  • Pingback: IOS – trigger navigation within scriptCQ User Experence | CQ User Experence

  • bsoriano

    you can place a submenu for each item, similar to the current app of the university of texas

  • Pingback: iOS iCL Slide-out Sidebar Menu - Delphi-PRAXiS

  • 張璋

    excuse me, do you know how to control how long we slide. in other words, can i control the size of the sliding menu? thank you

  • Erv

    I am doing this on xcode 5 and I keep getting the warnings: “Misplaced View – Frame for ‘Label News’ will be different at run time.” What am I doing wrong ?

  • abhi

    the navigation bar disappears when i switch the views

  • Svetlin Stoev

    The problem with the black bar at the top is because of iOS7 new status bar. More about this can see here http://www.doubleencore.com/2013/09/developers-guide-to-the-ios-7-status-bar/

  • Drake Grossman

    will this work with tab bar item instead of bar button item?

  • Pingback: Implementing facebook app slide menu in TabBarItem iOS - QueryPost.com | QueryPost.com

  • Ali

    Hi guys
    can you please tell me how to add fade in and fade out effect in trasition.

  • Guest 00009274

    Great !
    I have a problem trough:
    On iOS 6, my original app used to have a navigation controller as it’s initial controller,
    Now it’s the empty view controller, and my status bar which used to be translucent (transparent) is now Opaque ! no matter i set it’s style in the app delegate, in info.plist, in target settings or in the storyboard, it’s keeps being opaque.
    Any solution ?

  • Samuel J Ab

    Can someone halp!? Would be lovely to have this enhanced for IOS 7.

  • dee

    I followed your tutorial , but my side bar view’s background color is not the same as it’s tableview, but I fixed this problem by setting the background color of each table view cell . thanks anyway. :)

  • Pingback: Uanble to pop/access rootViewControllerCopyQuery CopyQuery | Question & Answer Tool for your Technical Queries,CopyQuery, ejjuit, query, copyquery, copyquery.com, android doubt, ios question, sql query, sqlite query, nodejsquery, dns query, update que

  • 10mitri

    I would like passing data between the front and the rear view controller but I don’t know how… My sideBar it’s a dynamic menu (json feed) and I would like to charge all item’s menu in the view did load of my front view controller (main page). How can I pass this item?
    Thank you for your help!

    • 10mitri

      I tried to use the segue “sw_front” but it doesn’t work…

  • darko

    hello
    great job, i found it useful. i have one problem… before reveal view controller i have few more (for example login and the like) and in sidebar view controller i have item “go back”. on clicking it it should jump back to one of previous view controllers (before reveal view controller). how it should be done? i couldn’t find “clean” way to do it

  • Pingback: How To Add a Slide-out Sidebar Menu in Your Apps | thomas bittel

  • Bmatichuk

    It uses around 30mb in iOS7 and you never get it back. It would be nice if there was a way to free it.

  • Chanchal

    If you compile and run the app, you’ll see an app displaying the “News Frontpage”. No, I don’t see News Frontpage, I see the while empty view controller, completely field to implement other things while I am stuck in initial stage.

    • Rakari

      You probably forgot to sign the blank view to the SWRevealController

    • Alex

      I know this might be kind of late, but I had the same issue. If you created your own files, you (like I did) forgot to make the connection with sidebarButton (declared in mainViewController) to the button on the navigation bar.

  • Ahmed

    I like this tutorial …. but i want to ask if i want to change the sidebar to right ????

  • Damien

    Hi, thanks for this tutorial. That was really helpful. But I found a small bug, if you are on the MapView, you can’t the slide to go back to the menu does not work. You have to click to the button. Otherwise you can not go back. I think, it’s because of the scrolling property of the mapView. Do you have any idea how to fix this ? Thanks.

  • [email protected]

    I have recently been using the full source code. I have added a couple of pages and now all of a sudden the pages that require info from a URL are taking long to load. What could I do to make this load faster. Maybbe add an Activity Indicator till the page loads??

  • Daniel Tovesson

    Great tutorial! Some questions though. When implementing the sidebar it seems like the “swipe to delete” function in individual cells gets disabled. I can set edit-mode so that all cells get into edit-mode but I can’t swipe to delete single cells. Is there any workaround here? Also, how do I disable the view that I pushed to the right when showing the sidebar? It’s annoying to have it active as I have a tableView there that you can click on.

    • Kartik Andd

      Hey, I have the same problem infact I was just about to ask here.

      Looking at the code of the RevealViewController, it sort of picks up any horizontal pan gesture….

      Perhaps the best thing to do is, when the press the cell, it slides across and shows the options. I think I might do that…..

      try the following search

      https://www.cocoacontrols.com/search?utf8=✓&q=tableviewcell

  • Norman Saadé

    First of all great tutorial! Everything is working great but when I tried to reproduce the tutorial I did not manage to add the bar button on the view controller “image view controller” and “map view controller”. Can you explain how you added the bar button although there is no navigation bar any more since the controllers are not linked to the navigation controller?

    • Norman Saadé

      I solved it myself. Here is what you have to do:
      - Select the photo view controller
      - In the attributes inspector select “Translucent Navigation Bar” under “Top Bar”
      - Add a Navigation Item
      - Add the Bar Button
      - Add the same code of the slidebarButton from the Main View Controller

  • frank

    hello,

    I was wondering how does someone go about creating sections (titles) in the review view controller (menu that slides out) without using the storyboards but programmically!?

  • Mary Herno

    quick question, in this tutorial everything was done thru storyboards, how can you program the menu items, like the titles (multiple titles for section in the menu, like facebook) without using storyboards but programming instead?

  • Rishad

    How can I add multiple sidebars for different ViewControllers? I have tried to add 2 side bars and it works fine for me but it is making the storyboard messy :-S. For each Viewcontroller I have to add one SWRevealViewController and one SidebarViewController and add the segues for each menu item. Can I not do it programmatically? Thanks

  • Mary Herno

    how can you create more then 1 title in the menu programmically

  • Mary Herno

    testing

  • Mary Herno

    if i wanted to disbale the touch of the view that slide out of view, but just wanted the side of the view to act like a slide back can this be done with this library?

  • Pingback: Segues does not take user from Slide-Out menu to next view | QueryPost.com

  • witsravi

    HI i am new to app development. I use this tutorial with my custom view. Everything is working fine only i am getting extra title bar. Can anyone suggest me where i am make mistake at the time of view design using storyboard.

  • witsravi

    HI Simon,
    Pls help me Out. I am in the between of my project.
    Your tutorial is great and it working fine with normal flow. But i need to use it like Facebook. I want slide view show after user login.
    1) create a view for login and another view for swreveal view controller.
    2) After that i add library files.
    3) create views for front view and back view
    But after that when i try to make connection between them. But it does not show seque for connection.

    So pls suggest me where i am making mistake. Pls see screenshot

  • Duffy

    Help and howdy! I’ve run into a small issue that I think most of you should be able to answer. I’m using iOS 7 with Xcode 5. Simply, I have the menu system working and I have the menu button on my main page. When I click on the menu to go to another page, it loads it but I lose the menu button and am pretty much stuck there. I’ve tried copying the button from the main view controller but it doesn’t show up in my storyboard. I understand I need to put the menu button there and slink it to sidebarbutton but I can never get the button to appear. :< Cheers and thanks to anyone that can lend a helping hand on this.

    • Maziyar

      I’m using iOS 7 Xcode 5. This is how I do for other viewController. I put a Navigation Item, then Bar Button Item inside Navigation Item, and a Button inside Bar Button. Then I set the Image property inside the Button to the icon that I want. Now it has an appearance but doesn’t do anything. Create an IBAction to your .m file or .h file and call revealToggleAnimated. It will look like this: – (IBAction)myLeftBarButton:(id)sender {
      [self.revealViewController revealToggleAnimated:YES];
      }

      It works fine on all of my viewControllers.

  • Blake

    I am running core data on my initial view controller and the app delegate is set to display my Table View Controller first which works..Problem is when I try and add these other views before it and change the app delegate to load the other view controller it crashes and gives me an NSInvalidArgumentException’, reason: ‘+entityForName: nil is not a
    legal NSManagedObjectContext parameter searching for entity name
    ‘Player…any idea how to make this work?

  • Jan

    I have one problem and am in need of assistance. Hi, i tried to add the SWRevealViewController to my project. This is how i did it. First i drag and drop a view controller and i made it the first and initial view of my project and then i attached the SWRevealViewController to it. And following what was done above, i pulled out a table view controller and i linked both the table view and the navigation controller(that was the initial view before implementing the ‘SWReveal’) with a custom segue from the view attached with the SWReveal. And then, just as it was shown above to add some code to the view controller after the navigation controller, i did so exactly.

    Before talking about my problem, this is the summary of what was done to my project to implement the sidebar navigation menu, there are only two views that i added to my project and that is the empty view controller and a table view controller, both in which i attached the SWRevealViewController and created a file with the interface as “SideBarController : UITableViewController” respectively. Also i added the two segues to both the table view controller and navigation controller and included the needed code unto my own created view that is positioned as the to-be loaded view after the navigation controller.

    Now my problem is that when i load the simulator, i did not go to the view that was positioned in the storyboard to be the view after the navigation controller. Instead i think that i am stuck viewing the view that has the SWRevealViewController attached to it. Is there any way to fix this? Did i forgot to do something? Thanks.

  • Thabib

    its partially working for me. If i select any cell fro slide bar it is navigating to that view but from that view i cant able to come back to main view the left bar button item is not visible at all…. Help me if any one knows the solution

  • Pingback: slider view between tabviewcontroller and collectoipnviewcontroller | ios - TrauBo.Net

  • Efrain

    I have used the tutorial and all is working fine. I tried to use a TableViewController to show information once a item on the SideBar menu is clicked. However, it doesn’t show the contents of the table. I did create a ViewController.h/.m for this view similar to the MapViewController.h/.m. Im not sure if there something I should add at SideBarViewController.m prepareForSegue in order for the app to manage segues to a TableViewController. I would appreciate any help or suggestion.

  • lks.

    Hey, great Tutorial :)

    When I’m doing this like the tutorial I dont have any problems.

    But I want to do a GroupeStyled Menu.. And than is the app crashing :/

    Here the error:

    2014-02-13 22:03:58.109 test2[7475:70b] *** Terminating app due to uncaught exception ‘NSRangeException’, reason: ‘*** -[__NSArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]‘

    *** First throw call stack:

    Has anyone an idea how to fix this? :/

  • Mrithula

    Hi, This tuitorial is great.. But I have a problem when I put a navigation controller say Controller A and push the SWRevealViewController. when i swipe from the edge of the FrontviewController it swipes to my controller A. :( Did anyone get such a situation?

  • kevin

    The following error appears when i try to launch after the first steps of the tutorial.

    Last step: If you compile and run the app, you’ll see an app displaying the “News Frontpage”. But that’s it. You won’t see the sidebar menu when tapping the list button. We haven’t implemented the action method yet.

    I can run the app but i get a complete white screen.
    Meanwhile I get the following output from Xcode:
    2014-02-19 11:54:07.200 SidebarDemo[566:13d03] Unknown class SWRevealViewController in Interface Builder file.

    I hope someone can help me

  • linuxito

    Hello, How can implement a second level for this menu?

  • Pingback: How I can achieve this sidebar menu with two columns – IOS? | QueryPost.com

  • Pingback: iOS Side menu | My Dev Note

  • Yasser Jennani

    Great tutorial , it works perfectly

  • Tim Foerster

    Hi ! I made all the view controllers I need and made the sw_rear and sw_front segue. In the tutorial it says the app would now show the main view controller (the news page) when I try to run it. But mine doesn’t, it only shows a black screen. Please help me, I’ve tried really hard to figure it out myself but it seems like I did everything like in the Tutorial

  • Michael M

    For those who want to use navigation controllers in their SidebarViewController just change the code in prepareForSegue of the SideViewBarController to this:

    - (void) prepareForSegue: (UIStoryboardSegue *) segue sender: (id) sender{

    if ( [segue isKindOfClass: [SWRevealViewControllerSegue class]] ) {

    SWRevealViewControllerSegue *swSegue = (SWRevealViewControllerSegue*) segue;

    swSegue.performBlock = ^(SWRevealViewControllerSegue* rvc_segue, UIViewController* svc, UIViewController* dvc) {

    UIViewController *newVC =[segue destinationViewController];

    [self.revealViewController setFrontViewController:newVC];

    [self.revealViewController setFrontViewPosition:FrontViewPositionLeft animated:YES];

    };
    }
    }

    This is a modified version of Jeremy’s answer. Thanks Jeremy.

  • Mark

    Can anyone help me with this question relating to this tutorial?

    http://stackoverflow.com/questions/22581458/adding-bar-button-item-to-left-of-navigation-item

  • Tander

    Awesome tutorial.

    Just one question: In a UiTabBar application, where my front view is my UItabBar and my side bar is a different controller – how can I send data to the side bar menu – when I open the slide out menu? Since prepareForSegue is not called?

  • Santosh Maharjan

    In the picture, when I click section B, i want to close slider menu. How can i achieve that? Thank you

  • HiVoid

    Hi, this is a great tutorial, and I really appreciate it. I initially disabled user interaction for some of the static cells. I want to enable them later programmatically. How can I access those static cells? Thank you!

  • Jerome sahayadarlin

    I keep getting an error in my console saying:

    *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil

    And this is the line of code that my apps stops running:

    [self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];

  • achien

    Hello! Is it possible to add a blank slide out view on the right side of the main screen in addition to an existing slide-out navigation panel on the left? Thanks!

  • nilkash

    Hi I tried this one every thing is going well. But I stuck at last point when I tried to do this inside prepare for segue

    [navController setViewControllers: @[dvc] animated: NO ];

    it gives me following error:

    2014-04-11 12:31:29.382 DemoSlideView[2897:60b] -[FrontView setViewControllers:animated:]: unrecognized selector sent to instance 0x8c498a0

    2014-04-11 12:31:29.416 DemoSlideView[2897:60b] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[FrontView setViewControllers:animated:]: unrecognized selector sent to instance 0x8c498a0′

    Thank you for such great tutorials. Thank you.

  • nilkash

    Hi I tried this one and its working fine. Only thing it stuck at last point. when I tried to replace ui view inside prepare segue like this :

    [navController setViewControllers: @[svc] animated: NO ];

    it gives me following error:

    2014-04-11 12:31:29.382 DemoSlideView[2897:60b] -[FrontView setViewControllers:animated:]: unrecognized selector sent to instance 0x8c498a0

    2014-04-11 12:31:29.416 DemoSlideView[2897:60b] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[FrontView setViewControllers:animated:]: unrecognized selector sent to instance 0x8c498a0′

    If I remove that one that one it works fine. but it is not replacing ui view. Need help.

    Thank you for such great tutorials. Thank you .

  • DoctorCobweb

    great tutorial. very helpful. indeeeed.

  • Ali

    Great Job, but I would like to mention that “rightRevealToggle” is not working :)

435 Flares Twitter 57 Facebook 340 Google+ 33 LinkedIn 5 435 Flares ×