Tabbar iOS Swift

In this story we will start with a Single View Application Xcode project.

What we see today.

  1. How to embed view controller in tab bar controller
  2. Selected and Unselected tab color

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

1. How to embed view controller in tab bar controller

Start from the very basic simply go to XCode and create a new project. Then select single view app.

After that go to main.storyboard and embed tab bar controller by selecting Editor -> Embed -> Tab bar controller.

After that you will get below screen.

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

2. Selected and Unselected tab color

Till the end of last topic we created a tab bar controller with one tab. Now we will create some more tab to implement Selected and Unselected tab color.

Now, we will add four more view controllers.

Select relationship segue (View Controller) as given below.

>>Add image and title to tabs

For this just select tab of view controller and Bar Item you can give name and image for tab.

>>Selected and Unselected tab color

For that just select tab bar of tab bar view controller. and add keypaths in identity inspector.

For selected tab color add tintColor

For unselected tab color add unselectedItemTintColor

as given below.

after run the app you will get below screen. Thank you!!! Happy coding.

--

--

--

I developed and maintain applications aimed at a range of iOS devices including mobile phones and tablet computers.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Deploying your Libgdx game to iOS TestFlight

Upgrade Your Swift API Client With Combine

iOS Developers Salary

Underline segment control programmatically (Swift)

Swift on AWS Lambda Performs Like Node and Python, Using Swift-Sprinter

Resolving “ITMS-90562: Invalid Bundle” email from the App Store

SWIFTip#5: Casual insight of the week

can’t get enough of imac screen removing. one with a psu other a random restart problem.

can’t get enough of imac screen removing. one with a psu other a random restart problem.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nitish Kumar

Nitish Kumar

I developed and maintain applications aimed at a range of iOS devices including mobile phones and tablet computers.

More from Medium

Execute Apollo GraphQL Query in iOS

Date picker as keyboard in iOS Swift

Swift Access Control

How to change button text in Swift Xcode 6?