WTF is a Protocol ?

This part of the Swift language is pretty simple to explain. A “Protocol” is what is called a “Interface” in most of the other languages out there. It is basically a set of rules that your struct, class, or enum has to conform to.

You maybe asking your self “why would I ever need this weird construct ? I know whats what. I don’t need these things if I am doing it all myself. ” Well thing is that it keeps you honest, and it keeps you on track.

More importantly it opens the door to things like delegates. More on this in my next blog post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s