Overview - Variables (let, var) and type inference
What is it?
Variables in Swift are names that store values you can use and change in your app. You use 'var' to create variables that can change, and 'let' to create constants that cannot change once set. Swift also guesses the type of value you store, called type inference, so you don't always have to say the type explicitly.
Why it matters
Without variables and constants, your app would be like a calculator with no memory — it couldn't remember or change information. Using 'let' and 'var' helps keep your code safe and clear by showing what can change and what cannot. Type inference saves you time and makes your code cleaner by guessing the type automatically.
Where it fits
Before learning variables, you should understand basic Swift syntax and data types like numbers and text. After this, you will learn about optionals and how to handle missing values, then move on to functions and control flow that use variables.