Testing Escaping Closures in Swift

Testing synchronous and asynchronous algorithms with escaping closures

Felipe Ricieri

--

Picture by Sigmund

Here’s a charade: I have two functions. Can you tell which one is synchronous and which one is asynchronous?

See below:

func doThis(_ closure: () -> Void) {
// …
}
func doThat(_ closure: @escaping () -> Void)…

--

--