🐦 Swift

What is Swift?

Lesson 1 of 5 ~5 min

Swift is Apple's modern, powerful programming language used to build apps for iOS, macOS, watchOS, and tvOS. It's designed to be safe, fast, and expressive — making it the go-to language for Apple platform development.

Archon is built entirely in Swift. Learning Swift is the first step toward understanding how your app works under the hood.

Why Swift?

Constants and Variables

Swift uses let for constants and var for variables. Constants are values that never change — and Swift encourages you to use them whenever possible.

Editor
Swift
Output

Try it

Change the value of name and downloads in the editor. Notice how string interpolation with \() embeds values directly into strings.

Basic Types

// Strings — text values
let city = "San Francisco"

// Integers — whole numbers
let age = 28

// Doubles — decimal numbers
let temperature = 72.5

// Booleans — true or false
let isLoggedIn = true

// Type annotations (explicit types)
let population: Int = 850_000
let rating: Double = 4.8

Quiz

Which keyword declares a constant in Swift?
Challenge

Create constants for your name and age, then print them with string interpolation using \().