Search code examples
iosxcodestoryboardios9storyboard-reference

Tab bar icon and title not showing with Storyboard References


I have the following storyboard with a segue to a storyboard reference:

enter image description here

The problem is that when I run the app, it doesn't show the icon or the title:

enter image description here

These are the item settings:

enter image description here

What am I missing?


Solution

  • Here's how to get the tab to show properly:

    1. Put the first UIViewController that will be embedded in the tab in the same storyboard as the UITabViewController. enter image description here
    2. Ctrl + Drag from the tab bar controller to the content view controller to make the connection as per usual. This will automatically add the UITabBarItem to the bottom of the content view controller. enter image description here
    3. Select the content view controller.
    4. Click the Editor menu and choose Refactor to Storyboard... enter image description here

    The UITabBarController tab will now point to the new storyboard reference... enter image description here ... and the content view controller preserves the UITabBarItem from the tab bar relationship. It will appear normally in the app now. enter image description here