Learning to Write Mac Apps in Swift is Excruciatingly Painful

If you’ve tried learning Cocoa programming to develop Mac apps, you probably have encountered frustration. You heard great things about Swift so you look at Apple’s documentation for a guide on writing a Mac app in Swift. Then you learn Apple hasn’t updated their Mac documentation in 10 years. Their guides are deprecated and the examples are in Objective-C. You can find class references in Swift, but when you’re starting out, you need more help than class references.

You search online for tutorials and articles on Mac programming and discover things aren’t much different than Apple’s documentation. The tutorials are old and the code is written in Objective-C. You can find lots of tutorials on iOS programming that use Swift but they don’t apply to the Mac. If you want to write Mac apps in Swift, you’re left to fend for yourself or ask questions on Stack Overflow and hope someone answers.

Learn How to Write Modern Mac Apps

To help introduce people to Mac development, I’m writing Swift Dev Journal’s Intro to Cocoa. In the book you’ll learn Mac development by making a complete Mac app from scratch using Swift and storyboards. Some of the Mac programming concepts you’ll learn as you make the app include:

  • View controllers
  • View-based table views
  • Text views
  • Menus
  • Notifications
  • Saving data
  • Undo
  • Timers

The book focuses on Mac programming. There aren’t going to be chapters on the Swift language that cover material that you can find online in dozens of places.

After finishing Swift Dev Journal’s Intro to Cocoa, you’ll be ready to write your own Mac apps and tackle Apple’s class references.

What About SwiftUI?

You heard about SwiftUI at WWDC. SwiftUI is a new way of building user interfaces for apps on Apple platforms. Doesn’t SwiftUI make learning Cocoa a waste of time? No it doesn’t.

  • It’s going to take Apple several years to get SwiftUI to the point where you can make Mac apps solely with SwiftUI.
  • SwiftUI on the Mac requires macOS 10.15, which kills off support for 32-bit apps. People who rely on older apps are going to be reluctant to update their operating system. If you want your Mac app to reach the widest possible audience, you still need to know AppKit and Cocoa.
  • SwiftUI works across all Apple platforms. The Mac has the most complex user interface so you need to know AppKit to make powerful apps that take advantage of the Mac’s power.

Learning Cocoa is not a waste of time if you want to make Mac apps.

Want a 50% Discount?

Sign up for the Swift Dev Journal newsletter, and you’ll get a 50% discount on Swift Dev Journal’s Intro to Cocoa when it’s released. You’ll also get the ebook Version Control for iOS and Mac Developers as a thank you gift for signing up.

I Want the Discount

indicates required