Skip to content

Instantly share code, notes, and snippets.

@sforteln
Created June 28, 2017 00:34
Show Gist options
  • Save sforteln/25d8ff994e016bc3f6a6ded290e7d04e to your computer and use it in GitHub Desktop.
Save sforteln/25d8ff994e016bc3f6a6ded290e7d04e to your computer and use it in GitHub Desktop.
WatchKit animation with completion block
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