Slide Out Menu

Discussion in 'iOS Programming' started by AxoNeuron, Dec 6, 2014.

  1. AxoNeuron macrumors 65816

    AxoNeuron

    Joined:
    Apr 22, 2012
    Location:
    The Left Coast
    #1
    I am having a small problem in the app I am making.

    I have figured out how to have a view controller become a slide-out menu. In the storyboard, it is its own separate view controller, and I instantiate it programmatically using the storyboard ID.

    Everything works absolutely flawlessly, I love it. But there is one huge problem. None of the UI on the menu actually works. I have tested it, the buttons and the tableview cells should be interactive. If you segue to this view controller, it actually works. But as a slide-out menu, if you put a button on it, when the user taps it nothing happens.

    [​IMG]

    I have tried using this code:

    Code:
    [self.navigationController.view bringSubviewToFront:self.settingsViewController.view];
    But even if I bring the settings view controller to the front it still isn't interactive. It seems as if there is some view controller in front of it (invisible) preventing it from working.

    Does anyone have any ideas on how to fix this? I can post all of the code if necessary, mainly I just use animateWithDuration to move the self.navigationController to the right.

    NOTE: I know that right now it looks rather ugly, I do plan on adding a few more items and improving the UI look and feel of the menu, but right now I am just trying to get it to work in the first place.
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    This is a side menu? Typically you use the child view controller APIs to make this work. I've used the below open source side menu code for this purpose and it works normally. You might want to look at that code to see how they do it.

    https://github.com/twotoasters/TWTSideMenuViewController
     
  3. AxoNeuron thread starter macrumors 65816

    AxoNeuron

    Joined:
    Apr 22, 2012
    Location:
    The Left Coast
    #3
    Yeah I use containment, the side menu is a child of the parent view controller.

    I know there are lots of free open options you can add to your project to do this, and they work well, but I want to learn how to do it myself sort of as a learning project. It is all working perfectly, when the user swipes from the left, the menu pops out but the only problem left is that none of the user-interactive elements in the side menu view controller are working.
     

Share This Page