Test your knowledge
A class can conform to:
Only one protocol
One or more protocols
A maximum of two protocols
When a class conforms to a protocol:
It cannot inherit from a class
It can inherit from an abstract class
It can also inherit from a class
A protocol:
Can inherit from another protocol
Can inherit from a class
Cannot inherit from another protocol
A protocol:
Is a type
Is a method
Is the base class for other classes
When we specify a protocol as the type for an argument:
We can use any type method that conforms to the specified protocol as an argument
We can use any protocol that conforms to the specified protocol as an argument
We can use any instance of a class that conforms to the specified protocol as an argument
If we want a protocol to be accessed outside of the module that defines it, which access modifier should we use to declare it?
open
public
filepublic