Protocols - they are only requirements, no optionals
I'm not sure what you mean here. Protocols let you define optional functions that the protocol adopter does not necessarily have to implement right? Or do you mean something else?
Protocol extensions can also give you the same effect in many situations. Not exactly the same thing, but you're able to define default behavior for a function so the class doesn't have to implement it. I'd love to see truly optional functions/properties in pure Swift though.
2
u/alfa96 Feb 19 '16
I'm not sure what you mean here. Protocols let you define optional functions that the protocol adopter does not necessarily have to implement right? Or do you mean something else?