// A TERMINAL TOOL FOR LEARNING SWIFT

Fix broken Swift, one file at a time.

94 small exercises that fail on purpose. Open one in your editor, fix it, save — swiftlings recompiles and tells you the moment it passes.

install
$ brew install swiftlings && swiftlings init
macOS & Linux · requires Swift 5.9+
swiftlings — watch
swiftlings
loops1 · 01_control_flow ██████████████░░░░░░░░░░░░░░░░ 42/94 45%
exercise
Exercises/01_control_flow/loops1.swift
// Use a for-in loop to iterate over the range and print each number
output · ✓ pass
✓ compiled ✓ ran 0.6s
1 2 3 4 5
✓ Exercise done — press n for the next exercise
n next h hint l list c check all x reset q quit
watch
Save. It just re-runs.
No commands to remember mid-session. Swiftlings watches the file, recompiles on save, and shows pass or fail instantly.
curriculum
94 exercises, 19 topics.
From basics to concurrency, generics, and Codable — each category ships with a README and links to the official docs.
stuck?
Hints on one keypress.
Press h for a hint, l for the full exercise list, x to reset and try again. Progress survives restarts.