Includes free updates for new Swift versions – click to read my update policy

Whether you have existing iOS skills or you're starting fresh, you can learn macOS coding by building real-world projects with Swift 4 and Xcode – all you need is in this course.


You can always be guaranteed you're learning the latest, greatest Apple technologies because all my tutorials are written for macOS 10.13.

100% SWIFT 4

Don't waste time with out of date tutorials – here you can learn smart, powerful, and expressive Swift the way it was meant to be written.


You learn Swift while you make real macOS projects, which means you get to apply your new skills immediately and see them work in context.


I've already taught thousands of people how to build iOS apps, and now I'll help you transfer your skills to macOS and unleash the power of your desktop.


Hacking with macOS teaches you Swift and macOS frameworks through real-world projects. The book includes the same comprehensive Swift introduction as Hacking with Swift, but I'm also packing the book with hints and tips that help you transfer your existing iOS skills to macOS painlessly.

Hacking with macOS includes 18 projects in total: six apps, six games, and six technique projects that focus on specific macOS APIs. The projects are:

  • Storm Viewer: Get started coding in Swift by making an image viewer app and learning key concepts.
  • Cows and Bulls: Practice your NSTableView skills while learning about random numbers and text input.
  • Social media: Return to project 1 and add a feature to let users share their selected picture.
  • Grid Browser: Power up your web browsing experience by viewing more than one site at a time.
  • Capital Cities: Learn to drop map pins and measure distance in this MKMapView game.
  • Auto Layout: Make your apps adapt intelligently to any size screen – it's easier than you think!
  • Photo Memories: Create watermarked videos using NSCollectionView with drag and drop.
  • Odd One Out: Build a picture-matching game using grid view and… particle effects?
  • GCD: Learn how to create background threads, delay work, and even parallelize complex operations.
  • WeatherBar: Display your local weather in the macOS status bar using JSON and GCD.
  • Bubble Trouble: Create a physics-based bubble popping game with timers, sound effects, and more.
  • Animation: Master Core Animation by learning a variety of ways to bring your UI to life.
  • Screenable: Get to grips with Core Graphics and NSDocument by building a screenshot-editing app.
  • Shooting Gallery: Build a fast-paced shooting game with animations, new levels, and a custom mouse cursor.
  • NSUndoManager: Learn to let your apps forgive and forget user mistakes with NSUndoManager.
  • Bookworm: Track the books you've read while writing any hardly any code. No, really.
  • Match Three: Build a ball-matching game with SpriteKit, while learning about shape nodes and particle emitters.
  • Bindings: Practice your bindings skill by converting temperatures with KVC and KVO.

While building projects, you'll learn all this and more:

  • How Cocoa on macOS differs from Cocoa Touch on iOS. (Note: if you're not interested in iOS, don't worry – you don't need any iOS experience to follow along, and the iOS parts are kept to a minimum!)
  • Creating advanced user interfaces with NSTableView, NSCollectionView, NSStackView, NSSplitView, and the all-new NSGridView.
  • How to build apps that look great in multi-window and tabbed user environments.
  • Designing your apps with powerful native components such as NSButton, NSTextView, NSSegmentedControl, NSImageView, and more.
  • Working with the filesystem, and using system services such as sharing and drag and drop.
  • Designing interfaces with and without storyboards, plus Auto Layout, alerts, modals, and sheets.
  • Handling mouse and keyboard events, animation, concurrency, and more.

Hacking with macOS follows the same approach I used with Hacking with Swift: small, standalone projects that teach individual techniques starting from scratch, so you end up with a huge library of finished projects you can develop further or use as the base for something entirely new.

If you loved Hacking with Swift, this is the sequel you've been waiting for.

Download full table of contents

Download free 24-page sample

Also available as part of the Swift Platform Pack bundle