laptop displaying code
laptop displaying code

As defined by the swift docs, a protocol is a blueprint of methods, properties and other requirements that suit a particular task or piece of functionality. Protocols can be adopted by a class, structure and enumeration. Basically, a Protocol is a set of predefined rules that can be passed onto classes, structs and enums to follow.

Defining a protocol

We define a protocol in a similar way to what we have seen before when defining a class or other types. We use a keyword to indicate what we are defining. …

Ashley Oldham

Career changer but still a problem solver. New to Code and blogging my experiences with it. Hoping this helps both you and I learn!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store