Skip to content

Instantly share code, notes, and snippets.

@juliengdt
Last active August 29, 2015 14:27
Show Gist options
  • Save juliengdt/3f7d141cf1cb22353fe8 to your computer and use it in GitHub Desktop.
Save juliengdt/3f7d141cf1cb22353fe8 to your computer and use it in GitHub Desktop.
Because Spring framework in Swift 2.0 is awesome, lazy functions are moaar awesome !!!
extension SpringView {
func fadeIn(duration: CGFloat, completion: (() -> ())? = nil) {
self.animation = "fadeIn"
self.duration = duration
self.animateNext() {
completion?()
}
}
func fadeOut(duration: CGFloat, completion: (() -> ())? = nil) {
self.animation = "fadeOut"
self.duration = duration
self.animateNext() {
completion?()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment