Generator.Element for SequenceType in Swift 3

For quick 2.2 I use this

extension SequenceType where Generator.Element == Character {

}

but when I want to convert to Swift 3, I have to use SequenceinsteadSequenceType

But

extension Sequence where Generator.Element == Character {

}

yeilds

Using the Undeclared Generator Type

So how to solve this problem?

+4
source share
1 answer

An overview of the language features for Swift 3 can be found at https://swift.org/blog/swift-3-0-released/ .

This specific change is part of SE-0006 Apply API Recommendations to the Standard Library :

The concept of "generator" is renamed to "iterator" for all APIs.

,

extension Sequence where Iterator.Element == Character {

}
+11

Source: https://habr.com/ru/post/1664168/


All Articles