Skip to content

Instantly share code, notes, and snippets.

@STAR-ZERO
Created July 7, 2016 03:42
Show Gist options
  • Save STAR-ZERO/2d29eec45570b9f638884c50bd04c790 to your computer and use it in GitHub Desktop.
Save STAR-ZERO/2d29eec45570b9f638884c50bd04c790 to your computer and use it in GitHub Desktop.
Swiftでfor inに対応させる
class Test: SequenceType {
typealias Generator = IndexingGenerator<[String]>
func generate() -> Generator {
return ["A", "B", "C"].generate()
}
}
let test = Test()
for t in test {
print(t)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment