Swift Variables & Constants
Before building UI, you must master the Swift language.
Code Snippet:
swift var playerName = "Chris" // Variable (can change) let gravity = 9.81 // Constant (immutable)
Concepts:
- Use
letby default for safety. - Type inference in Swift.
- Basic data types: String, Int, Double, Bool.