Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with UINavigationController #39

Closed
ghost opened this issue Dec 29, 2012 · 3 comments
Closed

Integration with UINavigationController #39

ghost opened this issue Dec 29, 2012 · 3 comments

Comments

@ghost
Copy link

ghost commented Dec 29, 2012

'm trying to integrate MFSideMenu in my project but I don't want to adopt the approach described in the GitHub depository as it defines the menu in the app delegate.

I have a login screen which will introduce with a segue (modal) a navigation controller with the main page as reported here: http://stackoverflow.com/questions/14084720/integrating-mfsidemenu-in-uinavigationcontroller

I would like to add the support for MFSideMenu in the navigationcontroller root controller using this code:

- (id)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];
    if (self) {
        // Custom initialization
        self.sideMenuController = [[SideMenuViewController alloc] init];
        UINavigationController *navigationController = self.navigationController;

        MFSideMenuOptions options = MFSideMenuOptionMenuButtonEnabled|MFSideMenuOptionBackButtonEnabled
        |MFSideMenuOptionShadowEnabled;
        MFSideMenuPanMode panMode = MFSideMenuPanModeNavigationBar|MFSideMenuPanModeNavigationController;

        MFSideMenu *sideMenu = [MFSideMenu menuWithNavigationController:navigationController
                                                     sideMenuController:sideMenuController
                                                               location:MFSideMenuLocationLeft
                                                                options:options
                                                                panMode:panMode];

        sideMenuController.sideMenu = sideMenu;

    }
    return self;
}

When I run the app the menu button appears in my navigation bar but,if I press on it,nothing happens.

Any idea about how to fix it?

Thanks a lot

@ghost
Copy link
Author

ghost commented Dec 29, 2012

I think I'm halfway to the solution. I've subclassed UINavigationController and used the afore mentioned code to setup the side menu. It works perfectly,only one problem: when my session expires I want to be redirected to the Login screen with a modal segue. The problem is that once the user logs in again and come back to the main screen with a modal segue the side menu doesn't work anymore (although the menu button is still displayed).

@nverinaud
Copy link

This could be because of issue #38 -___-

@mikefrederick
Copy link
Owner

@claus79 Can you come up with a sample project that displays the menu button not working? Or tell me how to reproduce it? I have tried presenting & dismissing a modal controller, but the menu button continues to work as it should.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants