RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion

Overview

ANIMATED TAB BAR

Swift UI module library for adding animation to iOS tabbar items and icons.


We specialize in the designing and coding of custom UI for Mobile Apps and Websites.

Stay tuned for the latest updates:


CocoaPods CocoaPods Carthage compatible Swift 4.0 Twitter Travis Donate

Requirements

  • iOS 9.0+
  • Xcode 10.2

Installation

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"

or Swift Package Manager

Usage

  1. Create a new UITabBarController in your storyboard or nib.

  2. Set the class of the UITabBarController to RAMAnimatedTabBarController in your Storyboard or nib.

  3. For each UITabBarItem, set the class to RAMAnimatedTabBarItem.

  4. Add a custom image icon for each RAMAnimatedTabBarItem

  5. 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

Included Animations

  • RAMBounceAnimation
  • RAMLeftRotationAnimation
  • RAMRightRotationAnimation
  • RAMFlipLeftTransitionItemAnimations
  • RAMFlipRightTransitionItemAnimations
  • RAMFlipTopTransitionItemAnimations
  • RAMFlipBottomTransitionItemAnimations
  • RAMFrameItemAnimation
  • RAMFumeAnimation

Creating Custom Animations

  1. Create a new class which inherits from RAMItemAnimation:
   class NewAnimation : RAMItemAnimation
  1. 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  
  }
  1. Example:
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")
    }
}

πŸ“„ License

Animated Tab Bar is released under the MIT license. See LICENSE for details.

This library is a part of a selection of our best UI open-source projects.

If you use the open-source library in your project, please make sure to credit and backlink to www.ramotion.com

πŸ“± Get the Showroom App for iOS to give it a try

Try this UI component and more like this in our iOS app. Contact us if interested.



Comments
  • Major issue when using hidesBottomBarWhenPushed. Please investigate

    Major issue when using hidesBottomBarWhenPushed. Please investigate

    Hey guys,

    First of all let me thank you for this amazing library! It really gives the applications a new dimension :)

    I have come across a major issue when trying to hide the TabBar while pushing another ViewController to the UINavigation stack. If the property hidesBottomBarWhenPushed is set on the ViewController that is about to be pushed, the TabBar behaves very strange...

    I have also tried using the animationTabBarHidden(true) method, but this requires that the hidesBottomBarWhenPushed property is not set. But if this property is not set, then the TabBar hides, but leaves an empty view at the bottom of the screen and when you pop from the pushed ViewController, the TabBar does not appear. Of course, you can call the animationTabBarHidden(false) method again on viewWillAppear: but there is a delay and does not look good.

    Please investigate this issue or if it is not an issue, please provide some guidelines on how to reach the expected behaviour.

    Cheers, Sasho

    opened by sasojadrovski 24
  • UITabbarItem hidden issue

    UITabbarItem hidden issue

    When I pushed from a VC to anothor VC,I want to hide the tabbar. So what I do first is set the "Hide Bottom Bar on Push" in the Storyboard ,the result is the tabbar is hidden indeed but the UITabbarItems are still.I also use UIVIew.animateWIthDurarion() to hide the tabbar but also failed.What can I do to hide the tabbar and the tabbaritem?

    opened by KittenYang 23
  • Unknown class - empty module in Xcode - will not build

    Unknown class - empty module in Xcode - will not build

    I keep getting this error in a simple project I made to test this code. I followed the instructions exactly:

    I noticed that all 3 items (tab bar controller, tab bar item, and object) can find the RAM"XYZ" class, but the "Module" field is set to "None" – which doesn't seem right. But I don't know how to make Xcode find the module. Help!

    2016-03-13 07:32:51.167 test-tab-bar[1465:59725] Unknown class RAMAnimatedTabBarItem in Interface Builder file. 2016-03-13 07:32:51.170 test-tab-bar[1465:59725] Unknown class RAMBounceAnimation in Interface Builder file. 2016-03-13 07:32:51.171 test-tab-bar[1465:59725] Unknown class RAMAnimatedTabBarItem in Interface Builder file. 2016-03-13 07:32:51.172 test-tab-bar[1465:59725] Unknown class RAMBounceAnimation in Interface Builder file. 2016-03-13 07:32:51.172 test-tab-bar[1465:59725] Unknown class RAMAnimatedTabBarController in Interface Builder file. 2016-03-13 07:32:51.185 test-tab-bar[1465:59725] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UITabBarItem 0x79152570> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key animation.'

    opened by decoyfox 14
  • Selected Icons not working

    Selected Icons not working

    When I use the tabbarcontroller programmatically and set both normal and selected images for RAMAnimatedTabBarItem . The selected icons never displayed , only normal ones.

    let tabBarItem2 = RAMAnimatedTabBarItem(title:"Facebook", image:UIImage(named:"750-home"), selectedImage: UIImage(named:"750-home-selected"))

    opened by engmsaleh 12
  • Animations don't work

    Animations don't work

    I've followed your tutorial to the tee.

    I have set the Tab Bar Controller to RAMAnimatedTabBarController.

    I have set each individual tab bar item to RAMAnimatedTabBarItem.

    I have added an object and hooked up the animation.

    And it still doesn't work. Where am I going wrong?

    question 
    opened by sjking85 10
  • Urgently: How can I change the selectedIndex tab?

    Urgently: How can I change the selectedIndex tab?

    When I use tabBarController?.selectedIndex it doesn't change the color in the animated tab, and I have tried using setSelectIndex() function but it didn't work, I really like this library but I have a deadline. Thanks in advance.

    opened by TareqElMasriDev 10
  • Issue with icon color

    Issue with icon color

    Hi, I'm having a little issue with the icon's color. Before a tab bar is selected, its icon's color is wrong.

    For example: my TextColor is dark grey, and my TextSelectedColor and IconSelectedColor are white. Before I select a tab bar it appears with dark grey text (which is correct) and white icon (which is wrong).

    screen shot 2015-06-15 at 9 33 11 am

    Have I configured something wrong? Or is it a bug? Thanks!

    opened by chenk1 9
  • tintColor of selected item

    tintColor of selected item

    First a fall, I want to say thank you very much for creating such a beautiful library. I love your lib, but I want to change the selectedItemImageColor and it's text color. I am able to change the tabbar item's text and icon color but not find any solution to change the default blue color for selectedItem. I want to change the color of selectedItemText and icon color. I tried Image tint from tab bar (storyboard) but still not changing the selectedItem color. When I change the class of tabbar controller to its default class (UITabbarController). It allow me to change the the selected item color.

    Thanks.

    question 
    opened by veer9002 8
  • Center tab bar item

    Center tab bar item

    Hello, I have 5 tab bar items and when user pressed center button first time it will go that view controller but I need also when user clicked same button second time it needs to close that center view controller and go back to main one. Also when user pressed first time its image should be changed to close icon but I can not figure it out how can I achieve this. Can you please help me?

    opened by atalayasa 8
  • Tabbar with larger middle button as shown in screenshot

    Tabbar with larger middle button as shown in screenshot

    Hi,

    the design example on the page looks great, what would be the approach to create a larger middle tab bar item (e.g. "Roles" in the image) with the animated tab bar?

    Thx & Cheers Thread

    opened by ThreadPitt 8
  • Crashes when used with multiple storyboards.

    Crashes when used with multiple storyboards.

    All works great for me if all view controllers are on the same storyboard. However, when using multiple storyboards, I can't find a setup that works. However I do I get this error...

    fatal error: items must inherit RAMAnimatedTabBarItem

    Maybe someone else has experienced this problem and has a solution to this? Thanks.

    bug 
    opened by HumidBrains 8
  • Followed everything but I didn't get anythings

    Followed everything but I didn't get anythings

    I followed everything what u mention in GitHub ,but I didn't get anythings.

    In the same time, my colleague has try to do everything, but also have a same result with me.

    Environment: Xcode 12.4 iOS 14.4

    opened by Jeremy-JM 5
  • Swiping between tabs

    Swiping between tabs

    Is it possible to add the functionality to swipe between the tabs https://github.com/marcosgriselli/SwipeableTabBarController This library allows it,but it requires subclassing the the tabbarcontroller which is RAMAnimatedTabBarController

    enhancement 
    opened by aakarshsasi 1
  • Can't find where to set top inset for tab bar image

    Can't find where to set top inset for tab bar image

    Hello!

    I'd like to make the image in RAMAnimatedTabBarItem more vertically centered, not sticking to the top of the RAMAnimatedTabBar's top. I suppose I have to change the top inset for the image inside the pod code.

    I have searched and found that this could be achieved by changing yOffset in method CreateContraints, but I have not found it anywhere in the current version pod. I have tried changing the Theme enum's properties and values in LayoutContainers(), neither seems to be working.

    Will you advise something, please? What to do instead of the CreateConstrains method? Or, perhaps, I missed it somehow even though I used the global search?

    opened by AlexanderParshakov 0
  • Swift version set to 5 in podspec

    Swift version set to 5 in podspec

    Swift version was 4.2 even though in the Package.swift it is 5. .swift-version file is removed because the cocoapods deprecated it and using now podspec swift version.

    opened by hamdshah 0
Releases(5.1.0)
Owner
Ramotion
UI Engineering, UI/UX Design and Front-End Development Agency
Ramotion
CustomTabBar - A Custom TabBar Built Using Swift

CustomTabBar Thanks to Riccardo Cipolleschi for his awesome tutorial. The TabBar

SM Arif Ahmed 1 Feb 14, 2022
Customisable iOS bottom menu works like Tabbar

SSCustomTabMenu Simple customizable iOS bottom menu works like Tabbar, in Swift. Features Simple and customizable iOS Tab Menu items, in Swift. Requir

Simform Solutions 81 Aug 3, 2022
A lightweight customized tabbar view. πŸ“Œ

A lightweight customized tabbar view. Screenshots Features Installation Setup ToDos Credits Thanks License Screenshots Features Easily Configurable an

Hemang 137 Dec 16, 2022
πŸ“± TabBar – highly customizable tab bar for your SwiftUI application.

TabBar SwiftUI standard TabView component is not so flexible and to customize it you have to modify appearance proxy of UITabBar or implement your own

Tamerlan Satualdypov 162 Jan 5, 2023
A curved tabbar with a center button

WHTabbar A very simple solution to implement center button in your native UITabbar. Example To run the example project, clone the repo, and run pod in

wajeehulhassan 18 Dec 4, 2022
TabDrawer is a customizable TabBar UI element that allows you to run a block of code upon TabBarItem selection

TabDrawer TabDrawer is a customizable TabBar UI element that allows you to run a block of code upon TabBarItem selection, or display a customizable dr

Winslow DiBona 503 Oct 5, 2022
Full Customizable Tabbar with IBInspectables

BEKCurveTabbar Full Customizable Tabbar with IBInspectables A fun replacement for UITabbar. The Component uses BΓ©zier paths. Demo Example usage: You c

Behrad Kazemi 169 Dec 5, 2022
CustomUI in SwiftUI - Full Native Custom SwiftUI NavBar, TabBar, SearchBar, Dark mode, a little bit animations

CustomUI_in_SwiftUI Full Native Custom SwiftUI NavBar, TabBar, SearchBar, Dark m

Alexander Ryakhin 1 Jun 5, 2022
ExpandedTabBar is a very creative designed solution for "more" items in UITabBarController

ExpandedTabBar is a very creative designed solution for "more" items in UITabBarController. It's greate experience to have more comfortable and intuitive UI.

Yervand Saribekyan, iOS Dev 256 Nov 1, 2022
A TabBarController with a unique animation for selection

BATabBarController Overview Recent Versions Language Version Swift 5 2.0.1 Swift 4 1.0.1 Obj C 0.1.6 The standard TabBarController is very limited in

Bryan Antigua 1.1k Dec 25, 2022
Pager is the simplest and best way to implement sliding view controllers in Swift

Pager is the simplest and best way to implement sliding view controllers. Installation Drop in the Spring folder to your Xcode project. Or via CocoaPo

Lucas Oceano 234 Aug 5, 2022
Paging view controller and scroll tab view

TabPageViewController Description TabPageViewController is paging view controller and scroll tab view. Screenshot Infinity Mode Limited Mode Customiza

M 1.3k Jan 7, 2023
Folding Tab Bar and Tab Bar Controller

FoldingTabBar.iOS Folding Tab Bar and Tab Bar Controller Inspired by this project on Dribbble Also, read how it was done in our blog Requirements iOS

Yalantis 3.7k Dec 21, 2022
A scroll pager that displays a list of tabs (segments) and manages paging between given views

ScrollPager A scroll pager similar to the one in Flipboard. The control creates a tabbar given a title or an image, and has the option of connecting t

Aryan Ghassemi 512 Aug 31, 2022
youtube iOS app template written in swift 5

Youtube iOS Template Youtube iOS Template is developed by Haik Aslanyan and written in Swift 3. Purpose of this repo is to show how ViewControllers ca

Henry Aslanyan 2.5k Jan 4, 2023
A custom tab bar controller for iOS written in Swift 4.2

A custom tab bar controller for iOS written in Swift 4.0 Screenshots Installation Cocoa Pods: pod 'AZTabBar' Swift Package Manager: You can use The Sw

Antonio Zaitoun 335 Dec 11, 2022
πŸ› WormTabStrip ViewPager for iOS written in Swift, which gives continuous feedback to the user when scrolling

Worm Tab Strip Worm Tab Strip is inspired by android SmartTabStrip, android view pager like library for iOS written in swift. Basically it was build u

EzimetYusup 176 Dec 13, 2022
A fully customizable container view controller to display a set of ViewControllers in a horizontal scroll view. Written in Swift.

DTPagerController This is a control for iOS written in Swift. DTPagerController is simple to use and easy to customize. Screenshots Default segmented

Tung Vo 290 Nov 13, 2022
Aesthetic floating tab bar ––– SwiftUI & Combine ⛓️ Importable via Swift Package Manager πŸ“¦

FloatingTabBar An aesthetic floating tab bar made with SwiftUI & Combine importabable via Swift Package Manager ?? Based off BottomBar-SwiftUI Preview

10011.co 135 Jan 8, 2023