I'm going through the iOS tutorial from Apple developer page.
It seem to me that protocol and interface almost have the same functionality.
Are there any differences between the two?
the difference usage in project?
Updated
Yes, I did read the link above and I'm still not sure what the differences and usage between protocol and interface. When I ask question like this, I would like to see a simple explanation about the topic. Sometime it could be tough to get everything from the documentation.
解决方案
Essentially protocols are very similar to Java interfaces except for:
Swift protocols can also specify properties that must be implemented (i.e. fields)
Swift protocols need to deal with value/reference through the use of the mutating keyword (because protocols can be implemented by structs and classes)
you can combine protocols at any point with the protocol<> keyword. For example, declaring a function parameter that must adhere to protocol A and B as:
.
func foo ( var1 : protocol ){}
These are the immediately apparent differences for a Java developer (or at least what I've spotted so far).