Swift programming for beginners
Dec 14, 2022
HI friends , in the topic we will start programming with Swift programming for IOS developers at beginner level.
Constants and Variables in Swift
The value of a constant can’t be changed once it’s set, whereas a variable can be set to a different value in the future.
You declare constants with the let
keyword and variables with the var
keyword.
For example :
let maximumNumberOfLoginAttempts = 10
var currentLoginAttempt = 0
maximumNumberOfLoginAttempt = 123; // this will give error because its constant and cannot be change.