Let\'s say I have these protocols:
protocol SomeProtocol {
}
protocol SomeOtherProtocol {
}
Now, if I want a function that takes a gener
The evolution to Swift 3.0 brings some changes. Our two choices now look a little different.
Using a where clause in Swift 3.0:
The where clause has now moved to the end of a function signature to improve readability. So multiple protocol inheritance now looks like this:
func someFunc(arg: T) where T:SomeProtocol, T:SomeOtherProtocol {
}
Using the protocol<> construct in Swift 3.0:
Composition using the protocol<> construct is being deprecated. The earlier protocol now looks like this:
func someFunc(arg: T) {
}
References.
More info on the changes for where are here: https://github.com/apple/swift-evolution/blob/master/proposals/0081-move-where-expression.md
And, more on the changes for the protocol<> construct are here: https://github.com/apple/swift-evolution/blob/master/proposals/0095-any-as-existential.md