3 ms·
Close. A protocol says that an object can (and in some (but not all) cases, is required to) implement a given list of methods, leaving the implementation/the "
by Zev 15y ago
Close.
A protocol says that an object can (and in some (but not all) cases, is required to) implement a given list of methods, leaving the implementation/the "how" up to the programmer. Think of protocols as being similar to interfaces in Java.
OTOH, A category says "in addition to the existing methods, this class will also, for sure, implement these additional methods — and here's how."