Swift

Swift – Modern Crash Course (2026 Edition)

0. First Things First – How to Actually Run Swift Code

Three realistic ways in 2025/2026:

Way Best for Speed to first line Recommendation for beginners
Xcode (Mac) Serious iOS/macOS apps Medium ★★★ (long-term best)
Swift Playgrounds Learning, small experiments Very fast ★★★★★ (start here!)
Online playgrounds No Mac computer Instant ★★★★ (good backup)
VS Code + Swift extension General scripting & backend Medium ★★★ (later stage)

Quick start recommendation for most people in 2025:

→ Open Swift Playgrounds (free on Mac/iPad) → Or go to https://swiftfiddle.com or https://www.swift.org/playground/

Let’s begin!


1. Hello World & Basics (5 minutes)

Swift

Variables & Constants

Swift

Type inference is super strong in Swift → you usually don’t write the type.

But you can write it:

Swift

2. Strings – You’ll use them A LOT

Swift

Useful string things:

Swift

3. Control Flow – if, switch, loops

Swift

Switch – very powerful in Swift

Swift

Very common modern pattern (2026+):

Swift

4. Arrays & Dictionaries (Collections)

Swift

Dictionary (key → value)

Swift

Looping (most common patterns)

Swift

5. Optionals – The thing that scares everyone at first

Swift

Modern short syntax (very popular 2024–2026):

Swift

6. Functions – Make your code reusable

Swift

7. Structs – Your own data types (very important!)

Swift

Quick Summary – Where You Are Now

You already know enough to read & understand ~70% of real Swift code!

What you know:

  • Variables / constants
  • Strings, numbers, booleans
  • if / switch
  • Arrays & Dictionaries
  • Optionals (? and ?? and if let)
  • Functions
  • Structs (your own types)

Next logical steps (choose your path):

Path What you’ll learn next Goal after 2–4 weeks
iOS / SwiftUI Views, @State, NavigationStack, List, Sheet Build real iPhone apps
Server / Backend Vapor / Hummingbird, async/await, Codable, APIs Build REST APIs
Swift scripting FileManager, ArgumentParser, regex, JSON Write useful command-line tools
Game / Graphics SpriteKit / SceneKit / Metal / RealityKit Make 2D/3D games & AR experiences

Would you like to continue with one of these paths?

  1. SwiftUI – make iPhone apps (most popular choice)
  2. Server-side Swift (Vapor / APIs)
  3. More fundamentals (enums, protocols, closures, async/await)
  4. Small real project (todo app, weather cli, quiz game…)

Just tell me which direction feels most exciting to you right now 😄