What is difference between 'let' and 'var' declaration ?
Answer / iosraj
constants are expressed with the ‘let’ keyword. So once assigned value can not be change, but assigned values using 'var' keyword can be change.
In terms of objective -c or compare with objective -c, 'var' is Mutable and 'let' is NonMutable.
let kMyConstant = 40
Or
let kMyConstant: Int = 40
var myString = "This is my string."
| Is This Answer Correct ? | 0 Yes | 0 No |
Is swift hard to learn?
Is swift easier than java?
What is @objc in swift?
What are adapter and memento patterns?
Is ios written in swift?
How to pass the data between view controllers?
Explain how you define variables in Swift language?
What is $0 and $1 in swift?
Who created swift?
What is the difference between nil and none in swift?
Difference in classes and structures in swift?
Explain what Lazy stored properties is and when it is useful?