SequenceType

A type that can be iterated with a for...in loop.

SequenceType makes no requirement on conforming types regarding whether they will be destructively "consumed" by iteration. To ensure non-destructive iteration, constrain your sequence to CollectionType.

Inheritance _SequenceType, _Sequence_Type View Protocol Hierarchy →
Associated Types

A type that provides the sequence's iteration interface and encapsulates its iteration state.

Import
  • import Swift

Instance Methods

func generate() Required

Return a generator over the elements of this sequence.

Complexity: O(1)

Declaration

  • func generate() -> Generator

Declared In

SequenceType, _Sequence_Type