• Actors

    Actors are one of the new features of Concurrency in Swift, and their main purpose is to solve one of the most common problems when dealing with concurrent operations: mutating shared state. When multiple threads access and mutate the same resource, there is no guarantee as to which thread will access the resource at a…

  • Task group

    The Task Group is a part of the new modern concurrency framework, and it allows us to run multiple asynchronous operations in parallel. In this previous article, we explored how we can create parallel operations using async let syntax. This approach is fine if we are going to perform two or three operations, but what…

  • Bridge Async Await, Delegates, Combine and Completion blocks

    Async await introduces a simpler approach to concurrency, so even in ongoing projects, it’s a good idea to incorporate async await syntax. However, instead of adding async await throughout the entire project, it’s better to gradually introduce the syntax in small parts of the code. That’s why it’s very important to bridge code between async…

  • Async Sequence

    Another great feature new modern concurrency is offering us is async sequences. Async sequence is similar to the regular sequence types we have in Swift but adds asynchronous code. We will loop over a collection of elements, as with regular Swift sequences, but all the elements are not ready yet when defining a loop. We…

  • Async Await Cancellation in Swift

    In this post, we are going to explore cancellation when working swift async await, starting from basic examples, which are sufficient most of the time, to more complicated cases when we want to perform more complex operations. For the simple case, we are going to have a button that will present a screen. This screen…