A guide to Swift for iOS Application Development

How to work through this course

This course is four phases and roughly sixty to eighty hours of real work. You can read it faster than that. You will not learn it faster than that, because the gap between reading Swift and writing Swift is wider than it looks and the only thing that closes it is typing.

Type the code. Do not copy it.

Every sample here is short enough to type and that is deliberate. Copying a block into Xcode teaches you nothing, because the part that teaches is the moment the compiler disagrees with you and you have to work out why. Swift's errors are unusually good - they name the type it expected, the type it got, and frequently offer the fix. A beginner who reads twenty error messages a day learns faster than one who reads twenty pages.

When a sample does something you did not expect, change it. Delete the guard and see what breaks. Swap the struct for a class and watch the behaviour change. The samples are starting points, not specimens.

Work in a Playground until Phase 2.

The whole of Phase 1 runs in a Playground, and should. An Xcode project brings a target, a scheme, a bundle identifier, an app lifecycle and a simulator, and none of those have anything to do with learning what an optional is. Open a Playground, learn the language, and start a project when you have something to put in it.

Give each phase its own pace.

Phase 1, two to three weeks. Do not rush optionals. Every Swift developer who finds the language annoying is someone who learned to silence optionals with ! instead of understanding what they are for. If if let and guard let are not yet automatic, stay here.

Phase 2, three to four weeks. Build small complete screens rather than reading about layout. A settings screen, a profile card, a list that filters as you type. The preview canvas makes the loop fast enough that you can try five arrangements in the time it takes to read about one.

Phase 3, three to four weeks. This is where an app starts behaving like software. It is also where most of the bugs you will meet professionally live, because the network is slow, unreliable and occasionally lies. Build something that fetches from a real public API.

Phase 4, four or more weeks. Architecture only makes sense once you have an app big enough to be hard to change. If Phase 4 feels abstract, go back and add three more screens to your Phase 3 app, then come back - the patterns will read as answers rather than rules.

Build one app the whole way through.

Pick something small and real on the first day and carry it through all four phases. A reading list. A workout log. A cost splitter for a shared house. One application you keep extending will teach you more than twenty tutorials, because only the thing you keep teaches you what happens when a decision you made in week one is still there in week eight.

Small matters. "An app for my book club" finishes. "A social network for readers" does not.

On the Simulator and the device.

The Simulator is fast and it lies in specific ways. It has no camera, no accelerometer, a perfect network and your Mac's processor, so it never shows you the performance of a four-year-old phone. Remote push notifications do not arrive there at all. Run on your own iPhone early - a free Apple ID is enough - and run on it regularly.

Where to look when you are stuck.

Apple's own documentation is good and is written by the people who wrote the framework; a search ending in "site:developer.apple.com" is usually better than one that does not. The WWDC session videos are the clearest explanations of anything new, and they are transcribed, so you can read them in ten minutes instead of watching for forty. Beyond that, Swift changes quickly: an answer from 2019 may be describing a framework that has since been replaced, and anything mentioning ObservableObject and @Published is describing the version of state management that @Observable superseded.

The last mile is the hard one.

Most people who learn iOS development never ship anything, and it is almost never the code that stops them. It is the certificate that will not validate, the screenshot at the wrong size, the privacy policy nobody wrote. Phase 4 covers all of it. Do that phase properly on a small app, with everything in place and submitted, before you need to do it on one that matters.