Simple animation for your views and cells
Table of Contents
GodAnimation is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'GodAnimation'
Upd. Swift Package Manager link:
https://github.com/daoinek/GodAnimation.git
At first, import GodAnimation in your swift file.
import "GodAnimation"
Show sample code:
GodAnimation.animateView(type: .fromLeft, animatedView: view, vc: self) { }
Parameter | Description |
---|---|
type | animation type |
animatedView | view to be animated |
vc | ViewController where the animated view is located |
- fromLeft
- fromRight
- fromTop
- fromBottom
- popIn
- popOut
- shake
- buttonTap
Animation name | Example | Animation name | Example |
---|---|---|---|
fromLeft | fromTop | ||
fromRight | fromBottom | ||
popIn | popOut | ||
shake | buttonTap |
Show sample code:
GodAnimation.cellAnimation(type: .cardDrop, cell: cell, indexPath: IndexPath) { }
Parameter | Description |
---|---|
type | animation type |
cell | cell to be animated |
IndexPath | cell indexPath |
Real use example:
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
if !shownIndexes.contains(indexPath) {
shownIndexes.append(indexPath)
GodAnimation.cellAnimation(type: .zoom, cell: cell, indexPath: indexPath) { print("Animation done.") }
}
}
- alpha
- wave
- leftToRight
- topToBottom
- bounce
- rightToLeft
- rotate
- linear
- zoom
- cardDrop
- dragFromRight
Animation name | Example | Animation name | Example |
---|---|---|---|
alpha | wave | ||
leftToRight | topToBottom | ||
bounce | rightToLeft | ||
rotate | linear | ||
zoom | cardDrop | ||
dragFromRight |