1

I am using the SWRevealViewController library and have set my respective views to 'sw_rear' and 'sw_front'. I know how to create a side menu if it was activated by a bar button item tap as such:

menuButton.target = self.revealViewController() 
menuButton.action = "revealToggle:"

I am trying to implement a version where the user taps the very right tab bar item and the side menu appears.

I dont know how to set a target and action for this to happen though.

mike157
  • 63
  • 3
  • 14
  • same way you did it with the menuButton.. just add a target and action to the right tab bar item as self.revealViewController() and "revealToggle:" – MSU_Bulldog Jun 09 '16 at 19:30
  • You can't add action to a tab bar item. Maybe this will help http://stackoverflow.com/questions/7575430/set-up-an-action-with-a-tab-bar-item-iphone – srvv Jun 09 '16 at 19:33
  • I tried using the tabBar method didSelectItem but there are no properties of the tabBar item to add a target and action – mike157 Jun 09 '16 at 19:34

1 Answers1

0

Instead of UITabBar, I used UIToolBar to achieve this. I placed bar button items on UIToolBar and called these methods.

//for right most bar button item
menuButton.target = self.revealViewController() 
menuButton.action = "rightRevealToggle:"
ddb
  • 2,423
  • 7
  • 28
  • 38
asd
  • 66
  • 7