Swift Tutorial : How to Create a CustomTabbar or Side Menu with One Common Code Structure?

August 3, 2016 2534

CustomTabbar is a common task for iOS App Developers. The look and feel of the standard tabbar in iOS 7+ are normal and good, but it doesn’t suit every time into the app’s design.

Nowadays, customizing tabbar is much easier than it was before, as Apple offers multiple simple ways to change the design of the tabbar: changing the background images, tint color, icons or text attributes offer many different ways to create a unique tabbar.

Objective

It is quite difficult to manage UI/UX. But with CustomTabbar, iOS developers can easily manage UI/UX. CustomTabbar is easy to manage than default tab bar.

Step 1: How to integrate ATTabbar.swift?

It’s simple, you just have to drag and drop “ATTabbar.swift” class in your project.

Step 2: How to Use ATTabbar.swift?

2.1 First, you have to create a “ViewController.swift” class

2.2 Now, assign it to a UIViewController in Storyboard and assign class ViewController (refer given image.)

2.3 After that, you have to add “Container” in ViewController in

@IBOutlet weak var container: UIView!

Step 3: In the next step, you have to define view controller and a destination identifier in “ViewController.swift”

Step 4:

In this step, we are adding four buttons in the bottom of UIViewController and give them a tag.

Step 5:

Now, create 4 new ViewControllers and name them “FirstViewController.swift”, “SecondViewController.swift”, “ThirdViewController.swift”, “FourthViewController.swift” and assign all them in storyboard as we have done with ViewController.

Step 6:

In this step, you have to connect all view controllers (“FirstViewController.swift”, “SecondViewController.swift”, “ThirdViewController.swift”, “FourthViewController.swift”) to “Container” in ViewController by custom Segue.

Output:

Hope, you found this blog helpful to create CustomTabbar or side menu with one common code structure. Let us know if you have any queries or concern regarding CustomTabbar in swift.

From January 2016, we have started Swift App Development for all the new iOS development projects and we recommend our clients to hire swift developer for iPhone and iPad app projects. We as a front runner in the industry would recommend you for your business to deploy your own swift application with less code at iTunes.