100% Mojave: You can always be guaranteed you're learning the latest, greatest Apple technologies because all my tutorials are written for macOS 10.14.
100% Swift 5.0: 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.
100% Practical: 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.
100% Proven: 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.
If you loved Hacking with Swift, this is the sequel you've been waiting for.
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.
What's in the course?
Hacking with macOS teaches you Swift and macOS frameworks through real-world projects. There's a comprehensive Swift introduction for beginners, 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:
1. Storm Viewer: Get started coding in Swift by making an image viewer app and learning key concepts.
2. Cows and Bulls: Practice your NSTableView skills while learning about random numbers and text input.
3. Social media: Return to project 1 and add a feature to let users share their selected picture.
4. Grid Browser: Power up your web browsing experience by viewing more than one site at a time.
5. Capital Cities: Learn to drop map pins and measure distance in this MKMapView game.
6. Auto Layout: Make your apps adapt intelligently to any size screen – it's easier than you think!
7. Photo Memories: Create watermarked videos using NSCollectionView with drag and drop.
8. Odd One Out: Build a picture-matching game using grid view and… particle effects?
9. GCD: Learn how to create background threads, delay work, and even parallelize complex operations.
10. WeatherBar: Display your local weather in the macOS status bar using JSON and GCD.
11. Bubble Trouble: Create a physics-based bubble popping game with timers, sound effects, and more.
12. Animation: Master Core Animation by learning a variety of ways to bring your UI to life.
13. Screenable: Get to grips with Core Graphics and NSDocument by building a screenshot-editing app.
14. Shooting Gallery: Build a fast-paced shooting game with animations, new levels, and a custom mouse cursor.
15. NSUndoManager: Learn to let your apps forgive and forget user mistakes with NSUndoManager.
16. Bookworm: Track the books you've read while writing any hardly any code. No, really.
17. Match Three: Build a ball-matching game with SpriteKit, while learning about shape nodes and particle emitters.
18. 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.
- 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.
Will it teach me Swift?
I've done my best to make sure this book is accessible to everyone: if you're just starting out I'll make sure and explain every concept, but if you're coming from iOS there are dozens of tips to help you transfer your existing skills to macOS.
Hacking with macOS comes with the same packed Swift introduction you get with Hacking with Swift, but after that it turns to focus on the powerful platform features that lie at the core of macOS. I'm working hard to cover as much of AppKit as possible, to help give you the best jump start possible for your own apps.
I already make iOS apps – is macOS so different?
iOS, macOS, tvOS and watchOS have a number of similarities, not least the Swift programming language that works across all of them. This means coming to macOS from iOS already gives you a head start because many concepts will be familiar to you – delegation, KVO, notifications, and closures for example all work the same.
But when it comes to user interface, macOS and iOS are worlds apart. The very nature of macOS is that it works in a multi-window environment where users can resizing apps or dock them as needed – your apps need to learn to existing alongside others, and integrate fully with the rest of the system.
I make a point of highlight everywhere macOS and iOS come together so you can transfer your skills faster. This means you don't need to learn many things from scratch, and can instead focus on the parts that are different.