Created
December 6, 2016 01:56
-
-
Save rchatham/d1d0989735fdd5daad3b89b8ce1f04b3 to your computer and use it in GitHub Desktop.
Chaining UIView animations
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
UIView.animate(withDuration: time, animations: { [unowned self] in | |
// animation | |
self.animationFunction() | |
}) { [unowned self] success in | |
// non-animation function | |
self.nonAnimationFunction() | |
UIView.animate(withDuration: time, animations: { | |
// animation | |
self.animationFunction() | |
}) { success in | |
// function that takes time | |
self.functionThatTakesTime { | |
UIView.animate(withDuration: time, animations: { | |
// animation | |
self.animationFunction() | |
}) { success in | |
UIView.animate(withDuration: time, animations: { | |
// animation | |
self.animationFunction() | |
}) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment