2
votes

I am new to Xcode and currently using Xcode 6.4 on OSX Yosemite 10.10.4. I encountered 2 issues on creating Tab Bar Controller:

Issue #1: I am trying to create Tab Bar Controller navigation and the tab navigation area is greyed out even after simply dragging Tab Bar Controller from Show Object Library.

This is what shown after I drag Tab Bar Controller to the storyboard. Notice there are no tab icon, all grey out.

enter image description here

I then have to update the tab bar item manually by going to Attribute Inspector and change the System Item from Custom to something else. Is this the right way of doing it?

Issue #2: If I create a new controller class (.swift) file and tried to associate it with the tab views, I got an error when running the app in the simulator. For example my swift file: Tab1ViewController.swift (subclass of UIViewController) and set it as the Class for tab view #1.

Error message when the app is run: 2015-08-03 12:43:07.883 TabBar[14436:238828] Unknown class Tab1ViewController in Interface Builder file.

Appreciate any inputs on this.

1

1 Answers

0
votes

After hours of trial and error, I found the solution to my problem. In my case, the issue is on the location where the Tab1ViewController and Tab2ViewController are created.

I have to select the following location if the assignment of the Class to Tab View to work:

enter image description here

It should look like this after the selection

enter image description here

And now when I set the Class for the ViewController, I can assign the new class that I created AND the module is pre populated properly

enter image description here

The Tab Item icons are also created automatically

enter image description here