I am playing around with Swift and am stumbling over the following problem: given I have the predefined class Animal
:
//Predefined classes
class
<>
is in Objective-C: conforms to protocol
<>
is in Swift for generics
You can do more with the where
keyword
Use where after the type name to specify a list of requirements—for example, to require the type to implement a protocol, to require two types to be the same, or to require a class to have a particular superclass.
Excerpt From: Apple Inc. “The Swift Programming Language.” iBooks.