Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Use GradientLoadingBar with PromiseKit.
import PromiseKit
import GradientLoadingBar
extension GradientLoadingBar {
func handle(promise: Promise<Void>) -> Promise<Void> {
return handle(promiseList: [promise])
}
func handle(promiseList: [Promise<Void>]) -> Promise<Void> {
show()
return when(fulfilled: promiseList)
.then { [weak self] () -> Void in
self?.hide()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.