0

I am a student and am trying to implement facebook app slide menu in my iOS app. Currently, I have it implemented using UIBarButtonItem, using SWRevealViewController API as explained in here. I have been researching on how to implement this using UITabBarItem instead, but have no luck finding it (I have been looking to other stackoverflow questions like this. Most of the discussion is talking about implementing it for UIBarButtonItem instead of UITabBarItem. I tried to modify and play around my code right now, but it's not showing any success. Basically I want the menu to be one of the tab items on the tab bar, instead of menubar. Any help will be appreciated, thank you!

Community
  • 1
  • 1
blenzcoffee
  • 851
  • 1
  • 11
  • 35

1 Answers1

0

Well, I guess you should assign revealToggle: when user selects UItabBarItem with given index. Let's say you have 4 controllers hooked to UItabBarViewController and you want the first one to be "menu". Then in MyTabBarController you should implement something like this:

-(void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{
  if ([tabBar.items indexOfObject:item] == INDEX_OF_MENU) {
      [self.revealViewController revealToggleAnimated:YES];
  }
}

This way if "menu" tabbarItem is selected you call revealViewController to slide. This is what you wanted?

raistlin
  • 4,298
  • 5
  • 32
  • 46