Side Navigation Click Not Working

CJ IOS Developer

I have implemented this slide menu from library iOS Slide Menu and used the uitabbarcontroller.

Home viewcontroller is having this slidemenu but on click of side navigation bar slide bar menu is appear but on click of records any action not happen. Whereas if I use the this slidemenu without tabbarcontroller than it is working.

Anyone if implemented this slide menu under the uitabbarcontroller using the storyboard using objective C in IOS. Please share your answer.

Nimit Parekh

In your code some of the changes I made like self.window.rootViewController into App Delegate.

Also I changed into the SlideNavigationController define new UINavigationController then give the Storyboard Id that access into the code which is below.

 UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone"
                                                             bundle: nil];
 self.landingScreen = (SlideNavigationController*)[mainStoryboard
                                                      instantiateViewControllerWithIdentifier: @"launchingNVCtr"];

Also some code changes into the appDelegate.

-(void)setupDrawers{
    UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone"
                                                             bundle: nil];
    self.landingScreen = (SlideNavigationController*)[mainStoryboard
                                                      instantiateViewControllerWithIdentifier: @"launchingNVCtr"];

    LeftMenuViewController *leftMenu = (LeftMenuViewController*)[mainStoryboard
                                                                 instantiateViewControllerWithIdentifier: @"LeftMenuViewController"];

    RightMenuViewController *rightMenu = (RightMenuViewController*)[mainStoryboard
                                                                    instantiateViewControllerWithIdentifier: @"RightMenuViewController"];

    self.landingScreen = [SlideNavigationController sharedInstance];
    self.landingScreen.rightMenu = rightMenu;
    self.landingScreen.leftMenu = leftMenu;
    self.landingScreen.menuRevealAnimationDuration = 0.18f;
    // Creating a custom bar button for right menu
    UIButton *button  = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
    [button setImage:[UIImage imageNamed:@"gear"] forState:UIControlStateNormal];
    [button addTarget:[SlideNavigationController sharedInstance] action:@selector(toggleRightMenu) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
    self.landingScreen.rightBarButtonItem = rightBarButtonItem;

    [[NSNotificationCenter defaultCenter] addObserverForName:SlideNavigationControllerDidClose object:nil queue:nil usingBlock:^(NSNotification *note) {
        NSString *menu = note.userInfo[@"menu"];
        NSLog(@"Closed %@", menu);
    }];

    [[NSNotificationCenter defaultCenter] addObserverForName:SlideNavigationControllerDidOpen object:nil queue:nil usingBlock:^(NSNotification *note) {
        NSString *menu = note.userInfo[@"menu"];
        NSLog(@"Opened %@", menu);
    }];

    [[NSNotificationCenter defaultCenter] addObserverForName:SlideNavigationControllerDidReveal object:nil queue:nil usingBlock:^(NSNotification *note) {
        NSString *menu = note.userInfo[@"menu"];
        NSLog(@"Revealed %@", menu);
    }];
}

Then following method for calling when tap on Log In button.

-(void)displayLandingScreen{
    [self setupDrawers];
    self.window.rootViewController = self.landingScreen;
}

Following code for when user tap on Log out.

-(void)logOutPressed{
    //mainTabBar
    UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone"
                                                             bundle: nil];
    UITabBarController *loginTab = (UITabBarController*)[mainStoryboard
                                                      instantiateViewControllerWithIdentifier: @"mainTabBar"];

    self.window.rootViewController = loginTab;
}

Also same code retrieve from the HERE.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Side Navigation Drawer Item click not working

Side Navigation Drawer Item click is not working although Navigation Drawer is visible and opens

Side-bar is not working on click

Navigation Menu item click not working

Page Navigation not working on Button Click

KineticJS click on right side of Rect not working in Chrome

How to close this side menu navigation when click other than side menu navigation div

jquery click navigation with multiple dropdowns not working

Why are the click events of the navigation drawer items not working?

Navigation drawer item click listener not working

Implementing navigation side bar to load <div>s link click

Full working example of react-native-side-menu with routes or navigation

Javascript click event not working in Blazor client side app

Action(Click) is working on layout xml file with NavigationView(Navigation drawer) implementation

Navigation bar side by side in Django?

How do i make my side navigation modul close when i click a link

Css side navigation transition

Settings of side navigation bar

Keeping sidebar navigation at the side

Jquery side navigation animation

Ionic Navigation side bar

ng-click not working on ion-item inside ion-side-menu

Click to expand side editor

Aligning 3 divs side by side in a navigation bar

On click not working

bottom navigation bar along with side navigation bar

top navigation resize when no side navigation

xamarin push notification ios Page navigation not working when push notification click

Side navigation bar arrow on active