Skip to content

EngrAhsanAli/AAViewAnimator

Repository files navigation

Table of Contents

#AAViewAnimator

Swift 4.0 Carthage compatible CocoaPods License MIT Build Status License MIT CocoaPods

##Description

AAViewAnimator is a simple, lightweight & easy-to-use rating bar designed to get and set ratings in iOS, written in Swift. It is a customised storyboard based UIView class that allows to customise in the UIStoryboard without writing code.

##Demonstration

AAViewAnimator is a collection of animations and transitions for UIView designed to apply animations on every UIView with options in iOS, written in Swift. It allows various options for animations and parameters to make them unique!

To run the example project, clone the repo, and run pod install from the Example directory first.

##Requirements

  • iOS 8.0+
  • Xcode 8.0+
  • Swift 3+

Installation

AAViewAnimator can be installed using CocoaPods, Carthage, or manually.

##CocoaPods

AAViewAnimator is available through CocoaPods. To install CocoaPods, run:

$ gem install cocoapods

Then create a Podfile with the following contents:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

target '<Your Target Name>' do
pod 'AAViewAnimator', '1.0'
end

Finally, run the following command to install it:

$ pod install

##Carthage

To install Carthage, run (using Homebrew):

$ brew update
$ brew install carthage

Then add the following line to your Cartfile:

github "EngrAhsanAli/AAViewAnimator" "master"

Then import the library in all files where you use it:

import AAViewAnimator

##Manual Installation

If you prefer not to use either of the above mentioned dependency managers, you can integrate AAViewAnimator into your project manually by adding the files contained in the Classes folder to your project.

#Getting Started

##Animate your view!

You can simply animate your view just by calling aa_animate function with animation option

Usage:

yourView.aa_animate(duration: 0.5, animation: .scale(rate: 1.2))

##Apply transition on your view!

You can simply apply transition your view just by calling aa_animate function with animation option

Usage:

yourView.aa_animate(duration: 1.2, springDamping: .slight, animation: animator) { inAnimating, animView in
if inAnimating {
// View is animating
}
else {
// View's animation is done
}
}

Note that the function signature for animation is: swift func aa_animate(duration: TimeInterval, springDamping: AAViewDamping, animation: AAViewAnimators, completion: ((_ isAnimating: Bool)->())? = nil)

##Animation types

AAViewAnimators Description
scale(rate:Float) Animation with scale effect
vibrateX(rate:CGFloat) Animation with vibrate at x axis effect
vibrateY(rate:CGFloat) Animation with vibrate at y axis effect
rotateLeft Animation with left rotation effect
rotateRight Animation with right rotation effect
rotateRound Animation with round rotation effect
zoomIn Animation with zoom in effect
zoomOut Animation with zoom out effect

##Transition types

You can use following animation transition:

AAViewAnimators Description
fromTop Transition from Top (View will be visible)
fromBottom Transition from Bottom (View will be visible)
fromLeft Transition from Left (View will be visible)
fromRight Transition from Right (View will be visible)
fromFade Transition with Fade (View will be visible)
toTop Transition to Top (View will not be visible)
toBottom Transition to Bottom (View will not be visible)
toLeft Transition to Left (View will not be visible)
toRight Transition to Right (View will not be visible)
toFade Transition with Fade (View will not be visible)

#Contributions & License

AAViewAnimator is available under the MIT license. See the LICENSE file for more info.

Pull requests are welcome! The best contributions will consist of substitutions or configurations for classes/methods known to block the main thread during a typical app lifecycle.

I would love to know if you are using AAViewAnimator in your app, send an email to Engr. Ahsan Ali

About

AAViewAnimator is a set of animations designed for UIView, UIButton, UIImageView with options in iOS, written in Swift.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published