© Andrés Ibañez Kautsch 2023
A. I. KautschModern Concurrency on Apple Platformshttps://doi.org/10.1007/978-1-4842-8695-1_9

9. AsyncSequence

Andrés Ibañez Kautsch1  
(1)
La Paz, Bolivia
 

In Swift, we have the concept of Sequences. Formally, Sequence is a protocol that types that need sequential and iterated access to their elements depend on. Arrays conform to Sequence, because you can iterate through them via a for-in loop, the forEach method , and with higher-order functions such as filter, map, and reduce. You can simply access their elements with a numbered index such as myArray[2]. Dictionaries are very similar. You can iterate over their keys and values in the same ways as an array, and to access an element in a dictionary, you can simply call ...

Get Modern Concurrency on Apple Platforms: Using async/await with Swift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.