Skip to content

Instantly share code, notes, and snippets.

@paskowski
Last active March 7, 2018 10:27
Show Gist options
  • Save paskowski/78810f1c0621c8c3b2c55a05a78fe874 to your computer and use it in GitHub Desktop.
Save paskowski/78810f1c0621c8c3b2c55a05a78fe874 to your computer and use it in GitHub Desktop.
extension AsyncOperation {
override var isAsynchronous: Bool {
return true
}
override var isExecuting: Bool {
return state == .executing
}
override var isFinished: Bool {
return state == .finished
}
override func start() {
if isCancelled {
return
}
main()
state = .executing
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment