Swift Challenge 9: Tabbed application

Hi! Sorry for not posting a result yesterday, I simply did not have the time. So I’m compensating for that today by posting 2 challenges. The first challenge is about tabbed applications. It’s the most basic one I’ve made but it’s pretty fundamental for creating apps in xcode.

Step 1

I started from creating a tabbed application when creating a new project, not implementing it afterwords. This will give you the tab controller + 2 pages on the storyboard.

Step 2

After that, I dragged a new View Controller to the storyboard from the Object library

Step 3

To connect the tab controller to the new page I held in ctrl and dragged from the Tab Controller to the newly created View controller. This opens the options page and then I selected under the header: Relationship Segue -> viewcontroller. This creates a new tab icon on the tab controller and a single icon on the view controller.

And here is the final result of the storyboard.

Step 4

I also created a new viewcontroller.swift file to connect to the newly created view controller.

Here’s the full code!

And here’s my source:

Challenge 10 will come later today!