SOTabBar

Light way to add Fancy bottom bar.

SOTabBar

? Requirements

SOTabBar requires iOS 9.3 or above, and is compatibile with Swift 4/5.

? Installation

CocoaPods

SOTabBar is available through CocoaPods:

pod 'SOTabBar'
Ruby

Carthage

SOTabBar is also available through Carthage:

github "Ahmadalsofi/SOTabBar"
Ogdl

? Usage

The Basics

  1. Set up your view controller with the an array of view controllers that you want to appear.
  2. Make your main View Controller subclass from SOTabBarViewController.
  3. return the array of your ViewControllers:
import UIKit
import SOTabBar
class MainViewController: SOTabBarViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        let firstVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "First_ID")
        let secondVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "Second_ID")
       
        firstVC.tabBarItem = UITabBarItem(title: "Home", image: UIImage(named: "firstImage"), selectedImage: UIImage(named: "firstSelectedImage"))
        secondVC.tabBarItem = UITabBarItem(title: "Chat", image: UIImage(named: "secondImage"), selectedImage: UIImage(named: "secondSelectedImage"))
	
        viewControllers = [firstVC, secondVC]
    }
}
Swift
  1. you can trigger your tab bar action by override the following function in your MainViewController
 override func soTabBar(_ tabBar: SOTabBarView, didSelectTabAt index: Int) {
      print("did Tapped On \(index)")
  }
Swift

? Customization

You should set your customization before return the array of the viewcontrollers

class MainViewController: SOTabBarViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // write here your customization before return the array

	SOTabBarSetting.Properties of  Customized = value

        let firstVC = FirstVC()
        viewControllers = [firstVC]
    }
}
Swift

tabBarHeight

    SOTabBarSetting.tabBarHeight = 100.0
Swift

tabBarHeight

tabBarTintColor

    SOTabBarSetting.tabBarTintColor = UIColor.red
Swift

tabBarTintColor

tabBarBackground

    SOTabBarSetting.tabBarBackground = UIColor.purple
Swift

tabBarBackground

tabBarCircleSize

    SOTabBarSetting.tabBarCircleSize = CGSize(width: 50.0, height: 50.0)
  	 // or 
    SOTabBarSetting.tabBarCircleSize = CGSize(width: 80.0, height: 80.0)
Swift

tabBarCircleSize_50

tabBarCircleSize_80

tabBarSizeImage

    SOTabBarSetting.tabBarSizeImage = CGSize(width: 40.0, height: 40.0)
Swift

tabBarSizeImage_40

tabBarShadowColor

    SOTabBarSetting.tabBarShadowColor = UIColor.red.cgcolor
Swift

tabBarShadowColor_red

tabBarSizeSelectedImage

    SOTabBarSetting.tabBarSizeSelectedImage = CGSize(width: 40.0, height: 40.0)
Swift

tabBarSizeSelectedImage_40

tabBarAnimationDurationTime

    SOTabBarSetting.tabBarAnimationDurationTime = 2
Swift

tabBarAnimationDurationTime_2

GitHub

Light way to add Fancy bottom bar 📲 — Read More

Latest commit to the master branch on 5-30-2021
Download as zip