Last active
August 29, 2015 14:27
-
-
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 !!!
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
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