AMSliderMenu- Open left menu programmatically

75 Views Asked by At

I am using AMSliderMenu where I want to display left slider menu on button click.I want to add left navigation button on dashboard, On the button click event open left slider menu.

I have added custom button to navigation left bar item.I have created MainViewController and LeftMenuViewController, but when I call "openLeftMenu" from dashboard, It doesn't open menu.

MainViewController *mainViewController = [[MainViewController alloc] init];

[mainViewController openLeftMenu];

I have tried by adding MainViewController to navigation, but by default it display first controller from left menu. I want to open menu on button click not first view controller.

Anyone have any idea how it will work?

1

There are 1 best solutions below

2
Shehata Gamal On

Try this inside button click

  MainVC*dd = [self.storyboard instantiateViewControllerWithIdentifier:@"main"];

 [self presentViewController:dd animated:true completion:^{

   [dd.mainSlideMenu openLeftMenu];

 }];