For swift 2.2 I use this
extension SequenceType where Generator.Element == Character {
}
but when I want to convert into Swift 3 I have to use
Sequence
instead of SequenceType
But
extension Sequence where Generator.Element == Character {
}
yeilds
Use of undeclared type 'Generator'
So, how can resolve this issue?
An overview of the language chances for Swift 3 can be found at https://swift.org/blog/swift-3-0-released/.
This particular change is part of SE-0006 Apply API Guidelines to the Standard Library:
The concept of "generator" is renamed to "iterator" across all APIs.
So your extension must be defined as
extension Sequence where Iterator.Element == Character {
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With