Giter Site home page Giter Site logo

sotabbar's Introduction

SOTabBar

CocoaPods Platforms





๐Ÿ“‹ Requirements

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

๐Ÿ“ฒ Installation

CocoaPods

SOTabBar is available through CocoaPods:

pod 'SOTabBar'

Carthage

SOTabBar is also available through Carthage:

github "Ahmadalsofi/SOTabBar"

๐Ÿš€ 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]
    }
}
  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)")
  }

๐ŸŽจ Customization

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

class MainViewController: SOTabBarViewController {

    override func loadView() {
        super.loadView()
	    // SOTabBarSetting.propertyToCustomize = value
    }
}

tabBarHeight

    SOTabBarSetting.tabBarHeight = 100.0

tabBarTintColor

    SOTabBarSetting.tabBarTintColor = UIColor.red

tabBarBackground

    SOTabBarSetting.tabBarBackground = UIColor.purple

tabBarCircleSize

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

tabBarSizeImage

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

tabBarShadowColor

    SOTabBarSetting.tabBarShadowColor = UIColor.red.cgcolor

tabBarSizeSelectedImage

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

tabBarAnimationDurationTime

    SOTabBarSetting.tabBarAnimationDurationTime = 2

๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป Author

โค๏ธ Contributing

Bug reports and pull requests are welcome on GitHub

๐Ÿ‘ฎ๐Ÿปโ€โ™‚๏ธ License

The library is available as open source under the terms of the MIT License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.