Properties2
| Type | Concept |
| Note created | Feb 17, 2025 |
In Swift, variable declarations are done using the var keyword.
var x = 1
x = 2To declare constants, use let. Try to use constants as often as possible instead of variables, it is safer and allows Swift to include some optimizations in the code.
let pi = 3.14When naming variables, you should use lower camel case (playerName). This is the expected case convention for all Swift elements except types and protocols (which use upper camel case).