In Swift, you create a constant using the let keyword:
let radius = 3.45 let numOfColumns = 5 let myName = "hi" print(radius)//from www . j a va2s.c o m print(numOfColumns) print(myName)
There is no need to specify the data type.
The data types are inferred automatically.
Here, radius is a Double, numOfColumns is an Int , myName is a String.