Creates an iterator that wraps the given closure in its
- Xcode 8.0+
- Swift Standard Library
A closure that returns an optional element.
bodyis executed each time the
next()method is called on the resulting iterator.
The following example creates an iterator that counts up from the initial value of an integer
x to 15: