UITabBar Using Swift

iOS Tutorials: TabBar Output

What is a UITabBar?

As you see in various application there is a bottom bar, that is actually a UITabBar which has buttons, and on the click of those applications screens are changed and some other functionalities are performed.

Those buttons are actually called as Tabs, it actually performs as a Menu in iOS Applications.

Some of the applications are shown below.

iOS Tutorials: UITabBar Example - App Store
UITabBar Example – App Store
iOS Tutorials: UITabBar Example - Music App
UITabBar Example – Music App

 

How to Add a UITabBar to an iOS Application?

  • Open Xcode
    • Hit Command + Space together, Spotlight Search appears, write Xcode and click on enter.
iOS Tutorials: Open Xcode, Create a new Xcode Application.
Open Xcode, Create a new Xcode Application.
  • Click on “Create a new Xcode project”
  • A window will appear asking to choose a template for the kind of application you are trying to create.
iOS Tutorials: UITabBar Choose Template
TabBar Choose Template
  • Select Tabbed App, as we are going to use UITabBar

 

iOS Tutorials: UITabBar Choose Template
TabBar Choose Template
  • Another Window will appear asking for the name of the project and initial configurations, we have named the project as “TabBarApp”.

 

iOS Tutorials: UITabBar App Configurations
TabBar App Configurations
  • A Finder window the will be asking for the folder location, where the project needs to be kept. Choose the desired the location from Finder Window and click on “Create”.

 

iOS Tutorials: UITabBar Project Destination
TabBar Project Destination

Note: Now we are all set as you can see this in front of you, an Xcode project is started and now you can kick-off development.

iOS Tutorials: TabBar Project Configuration
TabBar Project Configuration

We are now all set to see the project running; now we will compile and run the project.

What is the difference between Compile and Run?

Compile: When you build the project, it compiles everything together and tells the developer about the error in the project. (Command + B)

Run: If you run the project, first it’s compiled and then the project is executed, in case of no compilation errors. (Command + R)

Note: Run the project (Command + R), to see the output.

iOS Tutorials: TabBar Output
TabBar Output

 

Hope you licked the article!!.

Author: Chandra.rao

iOS Developer. #Life of an developer.... Learn New technology, Code, Learn New Technology, Code, Death.