TransitionableTab makes it easy to animate when switching between tab .
Move | Scale | Fade | Custom |
Contents
- Requirements
- Installation
- Preview
- Usage
- Communication
- Credits
- License
Requirements
- IOS 8.0 +
- Xcode 9.0 +
- Swift 4.0 +
Installation
CocoaPods
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapodsCopy the code
CocoaPods 1.1+ is required to build TransitionableTab 4.0+.
To integrate TransitionableTab into your Xcode project using CocoaPods, specify it in your Podfile
:
The source 'https://github.com/CocoaPods/Specs.git' platform: ios, '8.0' use_frameworks! Target '<Your target Name>' do pod 'TransitionableTab', '~> 0.1.1' endCopy the code
Then, run the following command:
$ pod installCopy the code
Carthage
You can install Carthage with Homebrew using the following command:
$ brew update
$ brew install carthageCopy the code
To integrate TransitionableTab into your Xcode project using Carthage, specify it in your Cartfile
:
Making "Interactive - Studio/TransitionableTab" ~ > while
Copy the code
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)
}
}Copy the code
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
}Copy the code
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)
License
TransitionableTab is released under the MIT license. See LICENSE for details.