Use storyboard links while saving icons and text for the tab bar controller

I started reorganizing one of my projects to make the code more manageable, and the tab bar controller lost its icons, for which the tab represents what. Without this, I slightly lost that tab for reordering purposes.

How do I get the icons displayed again for the tab bar controller when I use the storyboard links?

Refer to my attached image. Please note that the first 3 tabs are “empty”, but other tabs that I have not yet reorganized will show icons and headers.

For those not familiar with storyboard links, I followed the tutorial here: http://code.tutsplus.com/tutorials/ios-9-staying-organized-with-storyboard-references--cms-24226

enter image description here

Example storyboard Tasks for the icon to display correctly

enter image description here

+7
ios swift xcode-storyboard
source share
4 answers

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

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

+6
source share

It seems to be another solution that worked for me without changing the approach you went through:

  • Leave Storyboard Links Like This enter image description here
    • Go to the Initial View Controller in the reference storyboard
    • Add Tab Bar Item to Scene enter image description here
    • Set it up like you did in the UITabBarController storyboard. enter image description here
    • Clean and run enter image description here
    • Repeat it for all storyboard links.

Happy coding!

+5
source share

Refresh . This approach no longer works in Xcode 9.

Here's how to display the tab correctly:

  • Place the first UIViewController to be embedded in the tab in the same storyboard as the UITabViewController. enter image description here
  • Ctrl + Drag the tab bar from the controller to the content view of the controller to make the connection normal. This will automatically add the UITabBarItem to the bottom of the content. controller. enter image description here
  • Select a content view controller.
  • Select the Editor menu and select Refactoring in the Storyboard ... enter image description here

  • The UITabBarController tab will now point to the new Help ... enter image description here

  • ... and the content controller saves the UITabBarItem from linking between tabs. It will appear normally in the application now. enter image description here
+3
source share

For some strange reason, I couldn’t see the tab bar in the control overlay controller in IB. Although, by selecting it and expanding the Document Outline, I was able to see it in my watch list. I could make a change to it.

Document outline overview

enter image description here

Hope this helps! :)

0
source share

All Articles