# TransitionableTab [](https://github.com/Carthage/Carthage)   [](http://cocoapods.org/pods/Hero)  [](https://github.com/lkzhao/Hero/blob/master/LICENSE?raw=true) **TransitionableTab** makes it easy to animate when switching between tab .
|
|
|
|
|
|
|
|
|
## Usage
The usage of **TransitionableTab** is very simple
```swift
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
```swift
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
- GwangBeom Park ([@gwangbeom](https://github.com/ParkGwangBeom))
## License
TransitionableTab is released under the MIT license. See LICENSE for details.