Returns a sequence formed from repeated lazy applications of
next to a mutable
- Xcode 8.0+
- Swift Standard Library
The initial state that will be passed to the closure.
A closure that accepts an
inoutstate and returns the next element of the sequence.
A sequence that yields each successive value from
The elements of the sequence are obtained by invoking
next with a mutable state. The same state is passed to all invocations of
next, so subsequent calls will see any mutations made by previous calls. The sequence ends when
next never returns
nil, the sequence is infinite.
This function can be used to replace many instances of
Any that wrap a closure.