This project is maintained by Ramotion, Inc.
We specialize in the designing and coding of custom UI for Mobile Apps and Websites.
Looking for developers for your project? [▶︎CONTACT OUR TEAM◀︎]
The iPhone mockup available here.
Screencast from our Demo
- iOS 9.0+
- xCode 8
Just add the RAMAnimatedTabBarController folder to your project.
or use CocoaPods with Podfile:
pod 'RAMAnimatedTabBarController', "~> 1.5.3" swift 2.2
pod 'RAMAnimatedTabBarController', "~> 2.0.13" swift 3
or Carthage users can simply add to their Cartfile
:
github "Ramotion/animated-tab-bar"
-
Create a new UITabBarController in your storyboard or nib.
-
Set the class of the UITabBarController to RAMAnimatedTabBarController in your Storyboard or nib.
-
For each UITabBarItem, set the class to RAMAnimatedTabBarItem.
-
Add a custom image icon for each RAMAnimatedTabBarItem
-
Add animation for each RAMAnimatedTabBarItem :
- drag and drop an NSObject item into your ViewController
- set its class to ANIMATION_CLASS (where ANIMATION_CLASS is the class name of the animation you want to use)
- connect the outlet animation in RAMAnimatedTabBarItem to your ANIMATION_CLASS Demonstration video for step 5
- RAMBounceAnimation
- RAMLeftRotationAnimation
- RAMRightRotationAnimation
- RAMFlipLeftTransitionItemAnimations
- RAMFlipRightTransitionItemAnimations
- RAMFlipTopTransitionItemAnimations
- RAMFlipBottomTransitionItemAnimations
- RAMFrameItemAnimation
- RAMFumeAnimation
- Create a new class which inherits from RAMItemAnimation:
class NewAnimation : RAMItemAnimation
- Implement the methods in RAMItemAnimationProtocol:
// method call when Tab Bar Item is selected
override func playAnimation(icon: UIImageView, textLabel: UILabel) {
// add animation
}
// method call when Tab Bar Item is deselected
override func deselectAnimation(icon: UIImageView, textLabel: UILabel, defaultTextColor: UIColor, defaultIconColor: UIColor) {
// add animation
}
// method call when TabBarController did load
override func selectedState(icon: UIImageView, textLabel: UILabel) {
// set selected state
}
- Example:
class RAMBounceAnimation : RAMItemAnimation {
override func playAnimation(icon: UIImageView, textLabel: UILabel) {
playBounceAnimation(icon)
textLabel.textColor = textSelectedColor
}
override func deselectAnimation(icon: UIImageView, textLabel: UILabel, defaultTextColor: UIColor, defaultIconColor: UIColor) {
textLabel.textColor = defaultTextColor
}
override func selectedState(icon: UIImageView, textLabel: UILabel) {
textLabel.textColor = textSelectedColor
}
func playBounceAnimation(icon : UIImageView) {
let bounceAnimation = CAKeyframeAnimation(keyPath: "transform.scale")
bounceAnimation.values = [1.0 ,1.4, 0.9, 1.15, 0.95, 1.02, 1.0]
bounceAnimation.duration = NSTimeInterval(duration)
bounceAnimation.calculationMode = kCAAnimationCubic
icon.layer.addAnimation(bounceAnimation, forKey: "bounceAnimation")
}
}