0

I have a tabBarController which holds three viewcontrollers,and I want to add another UITabbarItem to the tabBarController which calls an alertView to display. The tabBarController is on storyboard.

ShahiM
  • 3,179
  • 1
  • 33
  • 58
trimi
  • 512
  • 1
  • 3
  • 5

2 Answers2

2

Try Following Steps :

  1. Add UITabBarItem to UITabBar.
  2. Disable added UITabBarItem.
  3. Add UIButton which same size of UITabBarItem to UITabBar.
  4. Add target and selector which display alert view
Hima
  • 1,249
  • 1
  • 14
  • 18
Chope
  • 79
  • 3
1

No. You can only add view controllers to a tab bar.
You could add a blank view controller that on viewWillAppear: would display the alert and then set the active tab to one of the others. I wouldn't recommend it. It's ugly and a very bad user experience.

Hima
  • 1,249
  • 1
  • 14
  • 18
Sam Corder
  • 5,374
  • 3
  • 25
  • 30