aryaxt / iOS-Slide-Menu

iOS Slide Menu with ability to add both left and right menu, and built in gesture recognizer. Similar to Path and Facebook
Other
1.53k stars 359 forks source link

How to add multiple button to the left side menu #164

Closed sahabe1 closed 9 years ago

sahabe1 commented 9 years ago

Hi aryaxt,

I want to add multiple button to the left menu on the navigation bar can we add. please help us how we can add multiple button please see attachment

Thanks ios simulator screen shot jun 23 2015 11 24 59 am

aryaxt commented 9 years ago

This code creates a side menu button

UIButton *button  = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
[button setImage:[UIImage imageNamed:@"menu-button"] forState:UIControlStateNormal];
[button addTarget:[SlideNavigationController sharedInstance] action:@selector(toggleRightMenu) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];

in viewDidLoad

self.navigationItem.rightBarButtonItems = @[rightBarButtonItem,anotherButton];