Skip to content

daoinek/GodAnimation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GodAnimation

Simple animation for your views and cells

Generic badge swift-package-manager made-with-swift GitHub license

Table of Contents

Installation

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

Usage

At first, import GodAnimation in your swift file.

import "GodAnimation"

View animation

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

Animation type

  • fromLeft
  • fromRight
  • fromTop
  • fromBottom
  • popIn
  • popOut
  • shake
  • buttonTap
Animation name Example Animation name Example
fromLeft fromLeft fromTop fromTop
fromRight fromRight fromBottom fromBottom
popIn popIn popOut popOut
shake shake buttonTap buttonTap

Cells animation

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.") }
        }
    }

Animation type

  • alpha
  • wave
  • leftToRight
  • topToBottom
  • bounce
  • rightToLeft
  • rotate
  • linear
  • zoom
  • cardDrop
  • dragFromRight
Animation name Example Animation name Example
alpha alpha wave wave
leftToRight leftToRight topToBottom topToBottom
bounce bounce rightToLeft rightToLeft
rotate rotate linear linear
zoom zoom cardDrop cardDrop
dragFromRight dragFromRight

About

Simple animation manager for your views and cells. Animation for your Swift (iOS) project

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published