Coder Social home page Coder Social logo

talebrafiepour / tvgtabbarcontroller Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 3.0 3.81 MB

beautiful TabBar with custom styles and animations

License: MIT License

Ruby 4.18% Swift 94.52% Objective-C 1.29%
tabbarcontroller tabbar tabbaritem tvgtabbarcontroller tab tablayout menu menubar bottom-navigation bottombar

tvgtabbarcontroller's Introduction

TVGTabBarController

beautiful TabBar with custom styles and animations

Demo

Here are some style of demos using TVGTabBarController.

default style With no tilte pointerStyle => Line
change attrs colors change attrs colors change attrs colors
with landscape mode

gif

Installation

CocoaPods

To integrate TVGTabBarController into your Xcode project using CocoaPods, specify it in your Podfile:

platform :ios, '13.0'
use_frameworks!

target 'YourProjectName' do
  pod 'TVGTabBarController'
end

And then remember to import TVGTabBarController module before using it.

Manually

You could directly copy and add the folder TVGTabBarController which contains 'TVGTabBarController.swift' file to your project.

Usage

You could use TVGTabBarController like you use UIViewController, create a ViewController and exteds it by TVGTabBarController programmatically. Additionally, clone this Demo project to find out how easy it is working.

Programmatically

    
import UIKit
import TVGTabBarController

class ViewController: TVGTabBarController {
    
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        initTVGTabBar()
    }
    
    fileprivate func initTVGTabBar() {
        var tabBarItem, tabBarItem2, tabBarItem3, tabBarItem4: TVGTabBarItem
        
        tabBarItem  = TVGTabBarItem(image: UIImage(named: "home")!, title: "Home")
        tabBarItem2 = TVGTabBarItem(image: UIImage(named: "like")!, title: "Like")
        tabBarItem3 = TVGTabBarItem(image: UIImage(named: "favorite")!, title: "Favorite")
        tabBarItem4 = TVGTabBarItem(image: UIImage(named: "profile")!, title: "Profile")
        
        let badge = TVGTabBarBadge(value:3, badgeColor: .red)
        tabBarItem.badge = badge
        
        
        let vc1 = storyboard!.instantiateViewController(identifier: "VC1ViewControlelr")
        let vc2 = storyboard!.instantiateViewController(identifier: "VC2ViewControlelr")
        let vc3 = storyboard!.instantiateViewController(identifier: "VC3ViewControlelr")
        let vc4 = storyboard!.instantiateViewController(identifier: "VC4ViewControlelr")
        
        self.delegate = self
        self.viewControllers = [vc1, vc2, vc3,vc4]
        self.tabBarItems = [tabBarItem,tabBarItem2,tabBarItem3,tabBarItem4]
        //self.tabsBadgeColor = UIColor.blue
        //self.tabsSelectedTintColor = .orange
        //self.tabsDefaultTintColor = .gray
        //self.tabsTitleIsHidden = true
        //self.tabsPointerColor = .orange
        //self.animDurationOfVC = 0.15
        //self.tabbarSize = .normal
        //self.tabPointerStyle = .circle
        //self.tabsFont = UIFont(name: "Arial", size: 14)
        //self.selectedViewController = vc3
    }
}


extension ViewController: TVGTabBarControllerDelegate {
    func tabBarController(_ tabBarController: TVGTabBarController, didSelect: UIViewController) {
        print("Delegate success!");
    }
}

๐Ÿ“„ License

TVGTabBarController is released under the MIT license. See LICENSE for details.

tvgtabbarcontroller's People

Contributors

talebrafiepour avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.