SwiftQuest

Guide

Can you learn Swift without a Mac?

Yes. Swift the language runs on Windows and Linux, and you can learn all of it in a browser. What needs a Mac is building and publishing apps for Apple's devices.

What needs a Mac, and what does not

Swift is open source, and its official releases include Windows and Linux as well as macOS. Everything that makes Swift Swift — types, optionals, structs and classes, enums, protocols, closures, error handling, concurrency — is the same language on all three.

What is tied to the Mac is Apple's app tooling. Xcode, the app Apple uses to build, sign and publish iPhone and Mac apps, runs only on macOS, and so do the SwiftUI previews people design screens with. So:

  • Learning Swift — any computer. No Mac needed.
  • Command-line tools and servers in Swift — Windows, Linux or a Mac.
  • Building an iPhone or Mac app and putting it in the App Store — a Mac with Xcode, in the end.

Learning the language first is not a detour. Every Apple framework, SwiftUI included, is built on it, and the language is what most beginners actually get stuck on.

Three ways to start without a Mac

  1. In a browser. A course that runs your code on its own servers needs nothing installed. That is how SwiftQuest works: you write Swift in the page, it runs on a real Swift compiler, and you see the output and Swift's messages a moment later. A computer with a keyboard is best; a phone works for reading, but typing code there is slow.
  2. Install Swift on Windows or Linux. The official installers are on swift.org, and the Swift extension for Visual Studio Code gives you completion and error messages as you type. This is the way to go once you want to build your own tools.
  3. On an iPad. Apple's Swift Playgrounds app teaches Swift on an iPad, no Mac needed.

The same Swift, wherever it runs

This prints the same thing on Windows, Linux and a Mac:

struct Hero {
    var name: String
    var health: Int
}

var hero = Hero(name: "Ash", health: 30)
var shadow = hero     // a copy: a second, independent Hero
shadow.health = 8

print(hero.health)    // 30
print(shadow.health)  // 8

Code that imports one platform's frameworks (UIKit, AppKit) only builds there, which is why SwiftQuest's lessons use only what Swift itself provides. Its course is checked on Linux as well as on a Mac.

What SwiftQuest does, and does not, teach

SwiftQuest teaches the Swift language, from your first line to a whole program built from a brief and checked by tests. It does not build iPhone screens. When you are ready for that, everything here carries straight over into Xcode.

Learn it by writing it

SwiftQuest is a Swift course in fifteen islands. Every quest has you write real Swift and run it on a real compiler, in your browser, with nothing to install. It opens soon, and the first two islands are free.