I just completed my first day of 100 days of SwiftUI. I learnt about variables today.
Variables allow you to store temporary data in your app. They are called variables because their value can be easily changed at any time.
The var keyword is used to declare a variable. After declaring a variable you can change its value anytime you want.
var myFirstVar = "Hello World"
The code above creates a variable called myFirstVar and set its value to Hello World.
myFirstVar = "Goodbye"
The code above changes the value of myFirstVar to Goodbye.
That's why they are called variables because you can easily change their value anytime you want.
See you tomorrow :)
Top comments (0)