Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Storyboard References While Retaining Icons & Text for Tab Bar Controller

I started refactoring one of my projects to make the code easier to manage and the Tab Bar Controller lost its icons for which tab represents what. Without this I'm a bit lost which tab is what for re-ordering purposes.

How do I get the icons to show up again for a tab bar controller when I'm using storyboard references?

Refer to my attached image. Notice how the first 3 tabs are 'blank' but the other tabs that I have not refactored yet show with the icons and titles.

For those unfamiliar with storyboard references I was following the tutorial here: http://code.tutsplus.com/tutorials/ios-9-staying-organized-with-storyboard-references--cms-24226

enter image description here

Sample of Tasks Storyboard to show Icon set Correctly

enter image description here

like image 493
Joseph Astrahan Avatar asked May 15 '16 17:05

Joseph Astrahan


2 Answers

It seems another solution that worked for me without altering the Approach you went through:

  • Leave Storyboard references as it's enter image description here
    • Go to Initial view controller in the referenced storyboard
    • Add Tab bar item to the scene enter image description here
    • Configure it as you have done in UITabBarController storyboard enter image description here
    • Clean & Run enter image description here
    • Repeat it for all Storyboard references

Happy Coding!

like image 179
Meseery Avatar answered Oct 02 '22 14:10

Meseery


First, in the storyboard where the tab bar controller is, there should be a scene for the referenced storyboard.

Just click on the scene that tab is associated with and click the tab bar at the bottom, then go to the attributes inspector, and you'll be able to assign a new icon to it.enter image description here

like image 35
VeganKid Avatar answered Oct 02 '22 14:10

VeganKid