Sequence

public extension Sequence
  • An async sequence that contains all the elements of the current sequence.

    let sequence = [0, 1, 2, 3].async
    
    for await value in sequence {
        print(value)
    }
    
    // Prints:
    // 1
    // 2
    // 3
    

    Declaration

    Swift

    var async: SequenceAsyncSequence<Self> { get }