- December 17, 2024
- Mins Read
Just add the RAMAnimatedTabBarController folder to your project.
or use CocoaPods with Podfile:
pod ‘RAMAnimatedTabBarController’
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 :
class NewAnimation : RAMItemAnimation
// 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
}
import RAMAnimatedTabBarController
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 = TimeInterval(duration)
bounceAnimation.calculationMode = kCAAnimationCubic
icon.layer.add(bounceAnimation, forKey: “bounceAnimation”)
}
}
A vertical stackview which takes subviews with different widths and adds them to it's rows with paddings, spacings etc.
AudioManager is a Swift package that provides a modular and easy-to-use interface for implementing audio feedback in your applications. It ...