Created
December 6, 2016 01:59
-
-
Save rchatham/cf41650db3091111b28d36ca1da2bf9f to your computer and use it in GitHub Desktop.
Chaining animations with SwiftyAnimate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Escape the Pyramid of DOOM! | |
Animate(duration: time) { [unowned self] in | |
// animation | |
self.animationFunction() | |
}.do { [unowned self] in | |
// non-animation function | |
self.nonAnimationFunction() | |
}.then(duration: time) { [unowned self] in | |
// animation | |
self.animationFunction() | |
}.wait { [unowned self] resume in | |
// function that takes time | |
self.functionThatTakesTime { | |
resume() | |
} | |
}.then(duration: time) { [unowned self] in | |
// animation | |
self.animationFunction() | |
}.then(duration: time) { [unowned self] in | |
// animation | |
self.animationFunction() | |
}.perform() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment