Skip to content

A wrapper for UIView animation which makes it easy to write sequences

License

Notifications You must be signed in to change notification settings

enabledhq/SequenceAnimator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SequenceAnimator

A wrapper for UIView animation which makes it easy to write sequences of animations

So instead of writing:

    UIView.animate(withDuration: 0.5, animations: {
        //Some animation
    }) { done in
        UIView.animate(withDuration: 0.5, animations: {
            //Do another animation after the first...
        }, completion: ...)
    }

You write:

    SequenceAnimator.animate(0.5) {
        //Some animation
    }.animate(0.5) {
        //Another animation after the first
    }.done {
        //We're done
    }

You can intersperse done blocks throughout the chained animations and also use delays

Take a look the included demo app

Demo

Which includes a comparison of implicit UIView animation syntax with SequenceAnimator

Code Comparison

Installation

Copy SequenceAnimator.swift to your project

About

A wrapper for UIView animation which makes it easy to write sequences

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages