Properties are variables and constants that are located inside the named type definitions. (structures, enums, classes and protocols) Stored Properties: Stored properties store actual values in each instance.
//Declaration of Stored properties
//All the above variables and constant are stored properties
- You can use this structure over an dover again to create instances
What is a structure? Structures are named types (more on that later). Structures are able to store named properties and define their own behaviors. How are they helpful? Well with Structures you can encapsulate properties and behavior that are related. You can declare a new type, then use it code. Structures create value types, whichRead More
Closure fundamentals: Closures are the same as functions, except they have no name. You are able to assign to a variable or constant and pass it around like all the other values. The following basic tutorial will teach you how to work with closures to leverage your data. Closures have the ability to ‘close overRead More
Mutable vs Immutable Collection Types: When you create a collection you must declare it as a constant or variable. If you don’t need to change the collection after you create it, then make it a constant (immutable). However, if you need to make changes, updates, remove an item, add an item or re-order it somehowRead More