Swift

Swift 3 – Structs !

Swift 3 – Structs !

Classes and structures are general-purpose, flexible constructs that become the building blocks of your program’s code. You define properties and methods to add functionality to your classes and structures by using exactly the same syntax as for constants, variables, and functions.

we define it with the struct followed by a name of the struct then open braces then close braces.

Inside the braces is where your properties go. Properties are like attributes of the struct.

 

 

Structs are complex data types, meaning that they are made up of multiple values. You then create an instance of the struct and fill in its values, then you can pass it around as a single value in your code.