I am playing around with Swift and am stumbling over the following problem: given I have the predefined class Animal
:
//Predefined classes
class
Swift 3 version
In Swift 3 the structure changed a bit. That´s why you will get a deprecation warning for the old structure. Here´s the new one:
For functions the expected protocols are located after the parameters definition of the function. Example:
func addAnimal(animal: T) where T: Nameable
For enums or classes the structure also changed
enum ZooEnum where T: Nameable
class Zoo where T: Nameable