Created
June 28, 2017 00:34
-
-
Save sforteln/25d8ff994e016bc3f6a6ded290e7d04e to your computer and use it in GitHub Desktop.
WatchKit animation with completion block
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 WKInterfaceController { | |
func animate(withDuration duration: TimeInterval, animations: @escaping () -> Swift.Void, completion: @escaping () -> Swift.Void) { | |
self.animate(withDuration: duration, animations: animations) | |
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + duration, execute: completion) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment