I'm confused as to the purpose of using protocols.
Is a protocol useful when you want an object to conform to a required set of methods? Let's say I have a class that I want to require certain methods to be implemented, I would then use a protocol to list out the required and optional methods?
Is a protocol useful when you want an object to conform to a required set of methods? Let's say I have a class that I want to require certain methods to be implemented, I would then use a protocol to list out the required and optional methods?