Constants; Conventions and Rules; Strings
With renewed vigour, I'm restarting my Swift journey, going over familiar ground! This has happened before, as it's comforting and easy to go through information I already know. However it is necessary and important. Along with the Treehouse tutorial videos, I've found another eBook 'App Development with Swift', which I'll use to supplement and check any of the key points. Swift Basics Video 4: Constants The analogy he makes here is that computers are not smart enough to figure out if something has changed. The purpose of constants is to create a value that will NEVER be changed. We can see what is inside the box (the glass box analogy!) but CANNOT change it! let language = "Swift" This is a simple example to show how a constant is created. If we try to change the value of 'language', then there will be errors! This is because it is a constant. Makes total sense. Xcode will show the 'red error' with the icon, which will the...