UIApplication BackgroundTasks Through The Lens of Closures

1 - The sync closure func processTwoNumbers(_ num1: Int, _ num2: Int, handler: (Int, Int) -> ()) { handler(num1, num2) } processTwoNumbers(10, 22, handler: { num1, num2 in print(num1 + num2) }) In the above, the handler is called in a sync matter. Same as below (1...100).forEach { val in print(val) } print(101) Uniqueness: The block passed in is executed immediately at the call site. 2 - The async closure β€” block isn’t stored....

February 22, 2022 Β· 6 min