I\'m going through the iOS tutorial from Apple developer page.
It seems to me that protocol
and interface
almost have the same functionality.>
Essentially protocols are very similar to Java interfaces except for:
protocol
way of protocol composition. For example, declaring a function parameter that must adhere to protocol Named
and Aged
as: func wishHappyBirthday(to celebrator: Named & Aged) {}
These are the immediately apparent differences for a Java developer (or at least what I've spotted so far). There's more info here.