Struct, Class and Protocol in Swift

credit — Treehouse Blog | Learn programming, design, and more — all online and on your own time. (teamtreehouse.com)

What is Swift?

What is a class in Swift?

class ClassName {
// class definition
}

What is a struct in Swift?

struct StructureName {
// structure definition
}

Class vs Struct

What is a Protocol in Swift?

--

--

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