Core types: numbers, Bool, String, Character
Explore Swift's core types: numbers, booleans, strings, and characters.
Intro
Swift core types cover numbers, booleans, strings, and characters. They are safe, efficient, and widely used.
Numbers
Swift offers numeric types: Int, Double, Float. Choose based on precision.
let intVal: Int = 42
let doubleVal: Double = 3.14
let floatVal: Float = 2.5
print("Int =", intVal, "Double =", doubleVal, "Float =", floatVal)All lessons in this course
- let vs var, type inference, literals, tuples
- Core types: numbers, Bool, String, Character
- Optionals intro: ?, nil, if let, guard let, ??