Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dimpiax/genericsequencetype
A minimal generator types of collection enumeration
https://github.com/dimpiax/genericsequencetype
Last synced: 3 days ago
JSON representation
A minimal generator types of collection enumeration
- Host: GitHub
- URL: https://github.com/dimpiax/genericsequencetype
- Owner: dimpiax
- Created: 2015-04-03T23:40:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-17T17:21:32.000Z (over 7 years ago)
- Last Synced: 2023-03-26T13:54:16.923Z (over 1 year ago)
- Language: Swift
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GenericSequenceType
A minimal generator types of collection enumeration##### Generator types
* Iterator
* Random
* Odd##### Usage
```swift
var boxCollection = Collection>()
boxCollection.addItems(Box(name: "Maps", age: 12), Box(name: "VHS", age: 1), Box(name: "Puzzles", age: 7), Box(name: "Books", age: 4))
for value in boxCollection {
println("do stuff with \(value)")
}
```##### Examples
```swift
// IteratorGenerator
boxCollection.addItems(Box(name: "Maps", age: 12), Box(name: "Puzzles", age: 7), Box(name: "Books", age: 4))
for value in boxCollection { println(value) }
// Box(name=Maps, age=12), Box(name=Puzzles, age=7), Box(name=Books, age=4)// OddGenerator
boxCollection.addItems(Box(name: "Maps", age: 12), Box(name: "Puzzles", age: 7), Box(name: "Books", age: 4), Box(name: "Photos", age: 72))
for value in boxCollection { println(value) }
// Box(name=Puzzles, age=7), Box(name=Photos, age=72)
```