Search code examples
iosswiftuitabbarcontrollerstoryboard-reference

How to set tab bar icon and title for a Navigation controller in different Storyboard which has reference in Main.storyboard?


I have two storyboards in which I am using tab bar controller in first storyboard and has storyboard reference of second storyboard with navigation controller as root controller. Currently I'm able to see two tabs but stuck at how to set image and title to second tab, that is referencing to navigation controller in second storyboard.

TabBarController in Main.storyboard TabBarController in Main.storyboard

Second storyboard Second storyboard


Solution

  • Select your navigation controller in second storyboard and open attributes inspector. At the top you'll see bottom bar option with inferred selected by default. Change that to translucent tab bar. Now from object library drag and drop "Tab Bar Item" on that translucent tab bar that just appeared. Now you can set the title and icon for that tab.