Coder Social home page Coder Social logo

shndrs / swiftytabbartransition Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 2.0 1.34 MB

This framework help you to give a better user experience to your user with smooth transition between TabBarItem

License: MIT License

Objective-C 2.62% Swift 92.10% Ruby 5.29%
uitabbarcontroller tabbarcontroller tabbar-transition custom-tabbar-controller swiftytabbartransition swift-tabbar-controller

swiftytabbartransition's Introduction

SwiftyTabBarTransition

SwiftyTabBarTransition codebeat badge swift-version Version Platform License Carthage Compatible cocoapods release-date

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

leftToRight scaleInXY

How to use

For enjoy this framework you have three simple steps:

Step 1

Let's import SwiftyTabBarTransition in top of your UITabBarController class first

import SwiftyTabBarTransition

Step 2

then in viewDidLoad() method of your UITabBarController, make delegate equal to self, pretty simple so far, right?! ๐Ÿ˜‰

class TabBarController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()
        delegate = self
    }
    
}

Step 3

your UITabBarController class, must inherite from UITabBarControllerDelegate protocol, so write an extension of your UITabBarController, then confirm from animationControllerForTransitionFrom method

extension TabBarController: UITabBarControllerDelegate {
    
    func tabBarController(_ tabBarController: UITabBarController, animationControllerForTransitionFrom fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
        
        let transitionOptions = SwiftyTabBarTransitionOptions(duration: 0.3, animationOption: .bottomToTop)
        let transition = SwiftyTabBarTransition.set(transition: transitionOptions)
        return transition
    }
}

Create an object of SwiftyTabBarTransitionOptions. This class has 2 peroperties:

  • duration

Which is the duration of transition

  • animationOption

Which is the style of transition animation

Animation Option

It's an enum for changing transition animation

animationOption
.scaleX
.scaleY
.scaleInXY
.scaleOutXY
.rightToLeft
.leftToRight
.topToBottom
.bottomToTop
.fade
.topLeftToBottomRight
.bottomLeftToTopRight

More Animations

scaleX topLeftToBottomRight

Requirements

iOS 9.3+

Xcode 10.2.1

Swift 5

Installation

SwiftyTabBarTransition is available through CocoaPods. To install it in latest version, simply add the following line to your Podfile:

Swift 4.2

pod 'SwiftyTabBarTransition', '~> 1.0.2'

Swift 5.0

pod 'SwiftyTabBarTransition', '~> 1.5.3'

To get the latest version of library using Carthage, you can add following line to your Cartfile.

Swift 4.2

github "shndrs/SwiftyTabBarTransition" "1.0.2"

Swift 5.0

github "shndrs/SwiftyTabBarTransition" "1.5.3"

Author

[email protected], [email protected], shndrs

License

SwiftyTabBarTransition is available under the MIT license. See the LICENSE file for more info.

swiftytabbartransition's People

Contributors

shndrs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.