Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

AxoNeuron

macrumors 65816
Original poster
Apr 22, 2012
1,251
855
The Left Coast
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_0151.PNG


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.
 
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

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.