Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/namshi/nmanimatedtabbaritem
A UI library to Animate UITabBar Items
https://github.com/namshi/nmanimatedtabbaritem
Last synced: 1 day ago
JSON representation
A UI library to Animate UITabBar Items
- Host: GitHub
- URL: https://github.com/namshi/nmanimatedtabbaritem
- Owner: namshi
- License: mit
- Created: 2018-03-20T07:11:01.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-21T12:57:35.000Z (over 5 years ago)
- Last Synced: 2024-10-06T10:34:33.582Z (about 1 month ago)
- Language: Makefile
- Size: 741 KB
- Stars: 9
- Watchers: 13
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# NMAnimatedTabBarItem
NMAnimatedTabBarItem is a Swift based UI module library for adding animation to iOS tabbar items and icons. iOS library made by [@Namshi Mobile Team](https://github.com/namshi).
![Demo](https://github.com/namshi/NMAnimatedTabBarItem/blob/master/Example/NMAnimatedTabBarItem/Images/NMAnimatedTabBarItem.gif)
## Requirements
- iOS 10.0+
- xCode 9
- Swift 4.2## Installation
Just add the NMAnimatedTabBarItem folder to your project. or use [CocoaPods](https://cocoapods.org/pods/NMAnimatedTabBarItem) with Podfile:
```ruby
pod 'NMAnimatedTabBarItem'
```## Usage
1. Import NMAnimateTabBarItem framework.
```swift
import NMAnimatedTabBarItem
```
2. Create an instance of type NMAnimateTabBarItem.
```swift
var animatedTabBar = NMAnimateTabBarItem()
```2. Adopt UITabBarControllerDelegate into your class.
```swift
class ViewController: UITabBarController , UITabBarControllerDelegate {
//do Your stuff
}
```
3. Implement UITabBarControllerDelegate method.
```swift
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
return true
}
```4. Find the index of selected tab and call animateTabBarItem.
```swift
let indexOfTab = tabBarController.viewControllers?.index(of:viewController)
animatedTabBar.animateTabBarItem(self.tabBar, indexOfTab!, 2 , NMAnimationtype.Bounce)
```
4. Make sure UITabBar item images are added.## Included Animations
* Bounce
* Rotation
* Transition
* Frame## Customized Properties
* Chenging animation duration.
```swift
animatedTabBar.duration = 0.2
```
* Providing transition Options.
```swift
animatedTabBar.transitionOptions = UIViewAnimationOptions.transitionFlipFromBottom
```
* Chenging rotation direction
```swift
animatedTabBar.direction = NMRotationDirection.right
```
* Passing image names for frame animation
```swift
animationType = NMAnimationtype.Frame
var imagesArray :[String] = []
for index in 0...35 {
imagesArray.append("frame_\(index)")
}
animatedTabBar.createImagesArray(imagesArray)
```
* Passing images for frame animation
```swift
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](https://github.com/namshi/NMAnimatedTabBarItem/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](https://github.com/Ramotion/animated-tab-bar).All right reserved. Namshi Team 2018.