alchemy-2024-SWIFT

variables

Datatypes

TypeInference

- let myAge = 35 //Integter
- let myName = "Girish " //Stign
- let temp = 87.5 //floating point
- let isValid = true // Boolean

type annotation

- let friend: String = "Girish "

Inbuilt functions

image

let firstName = "Girish"
let lastName = "V"
let age = 29
firstName + lastName // only strings can get joined if there is other type then use below format

"My name is \(firstName) \(lastName) and age is \(age)"

image