Latest 1.0.0
Homepage https://github.com/namshi/NMAnimatedTabBarItem
License MIT
Platforms ios 9.0
Authors

NMAnimatedTabBarItem is a Swift based UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Namshi Mobile Team.

Demo

Requirements

  • iOS 9.0+
  • xCode 9
  • Swift 3.2

Installation

Just add the NMAnimatedTabBarItem folder to your project. or use CocoaPods with Podfile:

pod 'NMAnimatedTabBarItem'

Usage

  1. Import NMAnimateTabBarItem framework.
    import NMAnimatedTabBarItem
  2. Create an instance of type NMAnimateTabBarItem.

    var animatedTabBar = NMAnimateTabBarItem()
  3. Adopt UITabBarControllerDelegate into your class.
    class ViewController: UITabBarController , UITabBarControllerDelegate {
    //do Your stuff
    }
  4. Implement UITabBarControllerDelegate method.

    func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
    return true
    }
  5. Find the index of selected tab and call animateTabBarItem.
    let indexOfTab = tabBarController.viewControllers?.index(of:viewController)
    animatedTabBar.animateTabBarItem(self.tabBar, indexOfTab!, 2 , NMAnimationtype.Bounce)
  6. Make sure UITabBar item images are added.

Included Animations

  • Bounce
  • Rotation
  • Transition
  • Frame

Customized Properties

  • Chenging animation duration.
    animatedTabBar.duration = 0.2
  • Providing transition Options.
    animatedTabBar.transitionOptions = UIViewAnimationOptions.transitionFlipFromBottom
  • Chenging rotation direction
    animatedTabBar.direction = NMRotationDirection.right
  • Passing image names for frame animation
    animationType = NMAnimationtype.Frame
    var imagesArray :[String] = []
    for index in 0...35 {
    imagesArray.append("frame_(index)")
    }
    animatedTabBar.createImagesArray(imagesArray)
  • Passing images for frame animation
    animationType = NMAnimationtype.Frame
    imagesList.append((UIImage(named: "image.png")?.cgImage)!)
    imagesList.append((UIImage(named: "image2.png")?.cgImage)!)
    imagesList.append((UIImage(named: "image3.png")?.cgImage)!)
    animatedTabBar.animationImages = imagesList

Manual

You can download the latest files from our Releases page. After doing so, copy the Swift file in the Sources folder to your project.

Demo

Check out the Example project.

Copyrights

This library has created by inspiration of RAMAnimatedTabBarController.

All right reserved. Namshi Team 2018.

Latest podspec

{
    "name": "NMAnimatedTabBarItem",
    "version": "1.0.0",
    "summary": "This CocoaPod library provides Tab Bar Item animation in a simple way.",
    "description": "NMAnimatedTabBarItem is a Swift based UI module library for adding animation to iOS tabbar items and icons. iOS library made [email protected]",
    "homepage": "https://github.com/namshi/NMAnimatedTabBarItem",
    "screenshots": "https://github.com/namshi/NMAnimatedTabBarItem/blob/master/Example/NMAnimatedTabBarItem/Images/NMAnimatedTabBarItem.gif",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Namshi General Trading L.L.C": "[email protected]"
    },
    "source": {
        "git": "https://github.com/namshi/NMAnimatedTabBarItem.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "swift_version": "4.1",
    "source_files": "Classes/*"
}

Pin It on Pinterest

Share This