0Pricing
Swift Academy · Lesson

Numbers, Booleans and Characters

Working with Int, Double, Float, Bool, and Character types.

Welcome

Swift has a rich set of built-in numeric types, a Boolean type, and a Character type for representing single Unicode scalars. Let's explore each.

Integer Types

Swift provides signed and unsigned integers at various bit widths: ```swift let a: Int = -42 // platform width (64-bit) let b: Int8 = 127 let c: UInt = 255 let d: UInt8 = 200 ``` Use `Int` for general-purpose integers; sized types when memory layout matters.

All lessons in this course

  1. let vs var: Constants and Variables
  2. Type Inference and Explicit Types
  3. Numbers, Booleans and Characters
  4. String Fundamentals and Interpolation
← Back to Swift Academy