Code Monkey home page Code Monkey logo

transitionabletab's Introduction

TransitionableTab

Carthage compatible Xcode 9.0+ iOS 8.0+ Version Swift 4.2 License

TransitionableTab makes it easy to animate when switching between tab .

Move Scale Fade Custom

Contents

Requirements

  • iOS 8.0+
  • Xcode 9.0+
  • Swift 4.2 (use version 0.1.3 for Swift 4.0)

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1+ is required to build TransitionableTab 4.2+.

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

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'TransitionableTab', '~> 0.2.0'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate TransitionableTab into your Xcode project using Carthage, specify it in your Cartfile:

github "Interactive-Studio/TransitionableTab" ~> 0.2.0

Run carthage update to build the framework and drag the built TransitionableTab.framework into your Xcode project.

Manually

If you prefer not to use either of the aforementioned dependency managers, you can integrate TransitionableTab into your project manually.


Preview

Usage

The usage of TransitionableTab is very simple

import TransitionableTab

class TabBarController: UITabBarController {

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

extension TabBarController: TransitionableTab {

    func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
        return animateTransition(tabBarController, shouldSelect: viewController)
    }
}

Custom

public protocol TransitionableTab: UITabBarControllerDelegate {

    func transitionTimingFunction() -> CAMediaTimingFunction

    func transitionDuration() -> CFTimeInterval

    func fromTransitionAnimation(layer: CALayer, direction: Direction) -> CAAnimation

    func toTransitionAnimation(layer: CALayer, direction: Direction) -> CAAnimation
}

If you want to know more detailed usage, please refer to Example.

Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Credits

License

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

transitionabletab's People

Contributors

agapovone avatar arlupin avatar parkgwangbeom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

transitionabletab's Issues

Not working animation

Use the code:

import UIKit
import TransitionableTab

class TabBarController: UITabBarController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.delegate = self
    }
}

extension TabBarController: TransitionableTab {
    
    func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
        return animateTransition(tabBarController, shouldSelect: viewController)
    }
}

Unfortunately, there is no transition animation between the controllers

How to disable the animation at navigationbar?

Hi, I have three ViewControllers and their color of navigationBar is different.
So change the tab by TransitionableTab, the color of navigationBar can't change smoothly.
How to deal with that problem, Hope to get your help.

Statusbar flicker during transition w/ UINavController

Hi,

Love the library - appreciate your work on this.

I discovered when you're using a VC like a UICollectionViewController that fills the full screen and you use a UINavigationController, you get a flash or flicker from under the status bar during the transition. This happens with light or dark status bars. Is there a way to eliminate this short of redoing the view?

Here's an example - look at the status bar during the transitions.

2018-11-13 18 54 12

Thanks again for the library!

Not working with selectedIndex

Hi,
I've noticed that your framework isn't working when programmatically selecting an index.

I'd like to have a function to select an index and animating the transition.

EDIT:
Temporary fixed with:

    func setSelectedIndex(index: Int) {
        guard let viewControllers = self.viewControllers else { return }
        _ = self.tabBarController(self, shouldSelect: viewControllers[index])
        self.selectedIndex = index
    }

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.