protocol
SequenceType
Inheritance |
_SequenceType, _Sequence_Type
View Protocol Hierarchy →
|
---|---|
Associated Types |
A type that provides the sequence's iteration interface and encapsulates its iteration state. |
Import |
|
Instance Methods
Return a generator over the elements of this sequence.
Complexity: O(1)
Declaration
func
generate
() -
>
Generator
Declared In
SequenceType
, _Sequence_Type
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 toCollectionType
.