All Projects → NSHipster → Cycle

NSHipster / Cycle

Licence: MIT license
A sequence that cycles between each of the items in a given sequence.

Programming Languages

swift
15916 projects

Cycle

A sequence that cycles between each of the items in a given sequence.

for (number, parity) in zip(0..<5, ["even", "odd"].cycled()) {
    print(number, parity)
}
// Prints:
// 0 even
// 1 odd
// 2 even
// 3 odd
// 4 even

License

MIT

Contact

Mattt (@mattt)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].