Convert a closure or a delegate to async / await
·1325 words·7 mins
With Swift 5.5 and the SE-0296 it is now possible to use async / await as in many languages such as C#, Typescript, Javascript or even Rust.
Until now we handled asynchronism in three different ways: the delegated as Apple does a lot, closures (also called completionHandler) as many do or with RxSwift or other libraries like Promise.
But with the arrival of async / await it is no longer necessary to go through all that.