I have a method that has this block inside:
func a(_ foo: () -> ()) { ... }
func b(_ foo: () -> ()) { ... }
func abc() {
a {
// some processing
b {
// some asynchronous work
}
}
}
When a button is tapped:
- I call method
abc()
- It connects to the internet
- The point is that it takes time to do so
I am looking for a way to cancel the previous block, and run the current block if tapped twice.