I’ve created a StoryBoard project and added a UITabBar
to my first view and a few UITabBar
items on it. I’m using a UITabBar
and not a UITabBarController
because the UITabBar
needs to be scrollable vertically so it is inside a UIScrollView
. I want to connect the UITabBar
items to different ViewControllers
. How do I do that inside the Interface builder?
With UITabBarController
it’s just a Ctrl+drag like everything else in the IB, but for some reason the UITabBar
acts differently. I’m aware of all the delegation methods I need to implement, but for now I’m only interested on how to connect the UITabBar
items to the views.
UITabBar
item ctr+drag to your nextViewController
(select style push, modal).UITabbarItem
tags.UITabBarDelegate
to your Controller.Add following delegate method
you can get my demo from following link
but problem is that
tabbar
will not appear on nextViewController
Try:
What you're probably after is UITabBarController.
You generally don't want to manage a
UITabBar
manually.If you're using storyboards, you can drag out a
UITabBarController
and then Ctrl-drag from it to other view controllers in the storyboard to link them to theviewControllers
property.