Ask HN: Book Recommendation for macOS Development
I'm trying to get back into macOS application development. I used to know the basics of Objective-C and Cocoa stuff back on the early days of Mac OS X with big cat names. At the time, I got a lot of value from the Cocoa Programming book from Big Nerd Ranch.
These days, it seems that every book about programming for Apple platforms is focused on iOS. Don't get me wrong, I love my iPad, but I'd rather develop desktop apps.
It appears to me that the documentation site has been neglected, and that the search engine algorithms favour returning videos and quick tutorials over books. Anyway, I'm having a hard time figuring out a good recent book about developing desktop apps for macOS. I don't care if it is Swift or Objective-C, I like both.
Can someone here point me in a good direction?
Thanks.
20 comments
[ 2.9 ms ] story [ 51.3 ms ] threadYou will be spending inordinate amounts of time in the Documentation Archive reading still applicable (and well written) docs, on S/O reading the ~3 threads that relate to your issue, blog posts from ~2010 and a whole lot of time searching specific APIs w/ GH code search to see how a repo from 2014 used it. And you’ll be alone in time and space if you’re not at a co while doing it.
Web developers are far more common, far cheaper, and far better supported by the ecosystem, you can literally just plug and play them entirely unlike eg iOS developers -> AppKit.
If this is a personal thing, have fun it’s very rewarding. If this is business/career, either learn Mandarin or turn around now, there is no hope or future here.
I've been doing Mac (and sometimes iOS) development almost ever since and as of right now make almost 2x my dad's career-high salary. That tiny market has treated me very well.
Riding a peak in a self admitted niche market all the way down and then recommending it to others as you yourself exit your career isn’t evidence, it’s irresponsible.
The simple fact you had a book on Cocoa programming written in the past decade (and official programming guides, offline/online discussion groups, WWDCs with more than a handful of events) should tell you something about the relative difference in the market since then.
The problem specifically with books is more that developer attention is split between Catalyst (UIKit), SwiftUI, and (AppKit | UIKit), and if you’re going to document something in this space, everything that isn’t AppKit has a larger audience.
But I do need to point out that AppKit is now in the position Carbon was in during the 2000’s — the future on macOS, if there is one, is evidently UIKit via Catalyst or SwiftUI no matter what assurances Apple makes. I would not advise a new developer to learn AppKit at this point in time.
I've been contracting on a "modern" mac app in SwiftUI for the last few months, one of the issues I see is that you can't actually get that far without AppKit right now unless you have the luxury of supporting only the latest macOS. Even then people often just don't upgrade their OS until they buy a new computer so you're stuck with whatever version of SwiftUI. It's a bit of a weird time for macOS development.
I’ve bridged several UIKit components into SwiftUI and it’s been fine. You have to be careful with Auto Layout, my approach was to divide into separate UIView and then wrap those in UIViewRepresentable, thus leaving the layout to SwiftUI. But that was the main thing to keep in mind.
AppKit may go away eventually, but _today_ it's still required to write a good Mac app even if you can use SwiftUI for large portions.
My experience on this project has also taught me that AppKit can be made to play quite nicely with SwiftUI. The AppKit code is encapsulated well, and from the outside gets instantiated and included exactly as if it were a SwiftUI component.
Catalyst is clearly an interim solution for a fairly narrow group of developers. If someone is planning on targeting macOS only then they can ignore it.
As a longtime Mac developer, I'm not super impressed. It's cool to get a build going for macOS quickly, but the effort required to make a non-trivial Catalyst app not suck turns out to be very significant.
I would definitely not even dream of using it to build a Mac-first/Mac-only app. The (debatable) advantages of UIKit over AppKit are just not even close to enough to outweigh the difficulty involved in making a good Catalyst app. The benefit of Catalyst is bringing an existing iOS codebase over and/or sharing code between platforms. It is not a better way to make a Mac app on its own merits.
https://developer.apple.com/learn/curriculum/
All you need to get started, it's free
Best way to make things easier for you is to sketch an idea, and learn as you go, swift is a fun language, and swiftui is the best GUI libraries i ever got to try
One thing.. XCode sucks.. if you like jetbrains product, there is AppCode: https://www.jetbrains.com/appcode/