TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Resources to Learn macOS Development?

172 pointsby smgover 2 years ago
Almost 25 years ago before I went down the rabbit hole of backend programming - I did some windows app development. I want to get into macOS programming now (I have been using a mac for the past 5 years and want to get to a place where I can build some hobby apps - I don&#x27;t need to make money - I just need the damn machine to do what I want it to) - but I am having difficulty figuring out the right resources.<p>I am not interested in API documentation or how-to recipes. I am looking for explanations that will help me build a conceptual understanding of macos UI development. What is the equivalent of the event loop under macos? Do events bubble up through the hierarchy? What is the right way to persist user configuration?<p>In the windows era there was a very famous book called &quot;Programming Windows&quot; by Charles Petzold. I am hoping that I can find similar book for macOS programming.<p>Please do point me to the resources that have helped you.<p>I am not interested in non-native frameworks like Electron or PyQt. If I am developing an app for myself I don&#x27;t want to deal with daily irritation of working with a non native framework.

32 comments

bluedinoover 2 years ago
I would suggest <i>Cocoa Programming for Mac OS X</i>, even though it&#x27;s based on Objective-C and the book is old. That means it&#x27;s based upon older versions of Xcode and Mac OS (like ~10 years old). Conceptually it&#x27;s a good book, but because of it&#x27;s age the code examples, etc are outdated. The publisher does have forums which can be helpful:<p><a href="https:&#x2F;&#x2F;forums.bignerdranch.com&#x2F;c&#x2F;cocoa-programming-for-os-x-5th-edition&#x2F;9" rel="nofollow">https:&#x2F;&#x2F;forums.bignerdranch.com&#x2F;c&#x2F;cocoa-programming-for-os-x...</a><p>They also have a Swift book, but I haven&#x27;t personally read it. They also have an Advanced Mac OS X book, but it&#x27;s also old and isn&#x27;t on their website anymore.<p><a href="https:&#x2F;&#x2F;bignerdranch.com&#x2F;books&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bignerdranch.com&#x2F;books&#x2F;</a>
评论 #34682027 未加载
评论 #34686149 未加载
评论 #34681606 未加载
mysticllamaover 2 years ago
&quot;I am looking for explanations that will help me build a conceptual understanding of macos UI development.&quot;<p>it depends on your learning style of course, but if you like lecture &#x2F; course-style learning, i highly recommend paul hegarty&#x27;s CS193P, it will definitely give you the in-depth, conceptual explanations you&#x27;re describing.<p>while it is an iOS dev course (taught at stanford, lectures are freely offered online), the newest lectures are using swiftUI for UI, so pretty much all of it will translate to doing macOS dev.<p>paul is a cs prof at stanford and worked at NeXT and then on the objc lang many, many years ago, so he&#x27;s been doing this a while and knows a thing or two :)<p><a href="https:&#x2F;&#x2F;cs193p.sites.stanford.edu&#x2F;" rel="nofollow">https:&#x2F;&#x2F;cs193p.sites.stanford.edu&#x2F;</a>
评论 #34683294 未加载
评论 #34684228 未加载
评论 #34682159 未加载
评论 #34682959 未加载
ChrisMarshallNYover 2 years ago
I had great luck with the Big Nerd Ranch books[0].<p>I’m not sure that I can recommend starting with SwiftUI, yet. The tech is still quite green, and quite different from AppKit (the current MacOS framework). The documentation also … <i>leaves something to be desired</i> …<p>But it also depends on how soon you want to be <i>shipping</i> software.<p>It might be a great idea to start with SwiftUI, if you think you’re still a couple of years from releasing stuff. I’m sure it will mature rapidly.<p>Of course, you could also learn a cross-platform system, like Electron, or React Native. I can’t make any suggestions, there.<p><i>Source: Been shipping native Mac software for over 30 years.</i><p>[0] <a href="https:&#x2F;&#x2F;bignerdranch.com&#x2F;books&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bignerdranch.com&#x2F;books&#x2F;</a>
gumbyover 2 years ago
If you&#x27;re not writing command line programs (99% of what I do) I suggest adopting SwiftUI for your interface.<p>It&#x27;s Apple&#x27;s future for cross platform (ios&#x2F;macos&#x2F;watch) applications. Hardcore longtime mac devs find it frustratingly unable to do some complex things they want to do (and yay that they do!) to take advantage of the mac OS. But you don&#x27;t want that; you just want to interact with your own code. And SwiftUI will let you do the basic stuff easily...and likely just (well, almost just) recompile your program for your iphone or ipad.
评论 #34682084 未加载
评论 #34683232 未加载
评论 #34682039 未加载
gwbas1cover 2 years ago
<i>Just do it.</i><p>I started with one of the Big Nerd Ranch books many years ago. I spent a few evenings reading it, and then spent a few hours dabbling with Objective C in XCode. I then got frustrated and put it down for a few years until I took a job that involved some Objective C. (This was over a decade ago.)<p>It&#x27;s surprisingly easy to learn the details of system calls by Googling and looking at stack overflow. Yes, the semantics are different, but the general theory is the same. There&#x27;s a main thread that&#x27;s often referred to as the main run loop. Accessing your UI outside of the main run loop (thread) is a big no-no.<p>As much as I want to vouch for learning Swift, (it&#x27;s really easy if you have a Java &#x2F; C# background,) there&#x27;s also a good reason to be proficient in Objective C: It&#x27;s just a layer on top of C. It&#x27;s very easy to wrap C APIs in Objective C and then call them from Swift. This is important, because if you&#x27;re trying to do something low-level, you will need to interact with a C API. (Although, Swift fixes a lot of the weirdness of Objective C if all you want is something that&#x27;s like Java &#x2F; C#.)<p>FWIW: There are some semantic differences that can take some time to adjust to. In Objective C, sending a message to a null object is a no-op instead of a runtime exception. Swift appears memory safe, but I&#x27;ve done things with timers that cause surprise crashes.
评论 #34686355 未加载
newaccount74over 2 years ago
I assume those questions are rhetorical, but let me try to answer them in a very terse form just so you have some terms to search the docs for. Assuming you want to use AppKit.<p>&gt; What is the equivalent of the event loop under macos?<p>NSRunLoop &#x2F; CFRunLoop. You rarely need to interact with it directly. Typically only the main run loop on the main thread is important, if you want to do something on a different thread you typically use dispatch queues (GCD=grand central dispatch) instead of run loops.<p>&gt; Do events bubble up through the hierarchy?<p>Yes, most events go up the responder chain, which is typically view -&gt; superviews -&gt; window -&gt; app. You typically respond to events by implementing methods defined in a protocol (like &quot;keyDown&quot; or &quot;insertTab&quot;) or by implementing delegate methods (&quot;windowWillClose&quot;). Sometimes you also have to listen for notifications from NotificationCenter.<p>&gt; What is the right way to persist user configuration?<p>NSUserDefaults for everything that can be serialised into a number&#x2F;string&#x2F;dictionary easily, and the application support directory for anything you want to store in files.
satysinover 2 years ago
Paul Hudson has a decent book on macOS programming using SwiftUI and AppKit. It isn&#x27;t perfect but it is a decent place to start <a href="https:&#x2F;&#x2F;www.hackingwithswift.com&#x2F;store&#x2F;hacking-with-macos" rel="nofollow">https:&#x2F;&#x2F;www.hackingwithswift.com&#x2F;store&#x2F;hacking-with-macos</a>
评论 #34681612 未加载
Austin_Conlonover 2 years ago
Here’s a tutorial from Apple on creating a Mac app with the latest declarative framework: <a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;tutorials&#x2F;swiftui&#x2F;creating-a-macos-app" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;tutorials&#x2F;swiftui&#x2F;creating-a-mac...</a>.
jessegrosjeanover 2 years ago
One thing to decide maybe before specific books is if you want to do SwiftUI programming or more traditional Cocoa programming. They both have advantages, and they can be mixed, but if you are just learning probably best to focus on one approach to start.<p>SwiftUI is new future according to Apple, easy to start, but also unpolished compared to Cocoa. Cocoa is old and polished, but maybe eventually a legacy technology. I&#x27;m personally still in Cocoa world, but parts of SwiftUI are interesting.
_hanover 2 years ago
I recently did the SwiftUI tutorials that had a chapter on macOS (from the context of adding macOS as a target alongside iOS). <a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;tutorials&#x2F;swiftui" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;tutorials&#x2F;swiftui</a><p>I expect SwiftUI to stay pretty high-level so don’t expect nitty gritty details. But Apple seems to be putting a lot of effort there so you might want to check it out.
tonymetover 2 years ago
Apple&#x27;s Own Developer Documentation is Exceptional ranging from Cookbook-style guides to Reference Documentation.<p><a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;technologies" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;technologies</a><p>There are dozens of entrypoints depending on the framework (e.g. SwiftUI, Cocoa, CoreFoundation etc. ) , Platform &amp; Application you are interested in .<p>I recommend starting with an application in mind (e.g. a MenuBar Utility, Notification Bar Widget, Standalone App, CLI utility, etc) and then digging through Apple&#x27;s own framework documentation .<p>That will give you the e2e experience covering all the tools &amp; frameworks needed to finish the task. Then repeat with a more complicated app or one in a different domain.
评论 #34682964 未加载
评论 #34682563 未加载
strebloover 2 years ago
In a past life I spent a lot of time developing for iOS, and the one incredibly sore spots in terms of documentation was the build process. Particularly, what are all the things I need to know to effectively build my app, and debug the process.<p>The Apple-provided documentation assumes you already know many of the ins and outs of C&#x2F;C++ build arcana, and on top of that does a terrible job of explaining what parts XCode adds or subtracts to the process. I never came across a resource for this information that was even passable, and wound up getting most of my answers from IRC.
danpalmerover 2 years ago
To get started, I&#x27;d Protocol Oriented Programming from WWDC. Not a tutorial or how-to, but more of a look into the philosophy behind Swift.<p><a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;videos&#x2F;play&#x2F;wwdc2015&#x2F;408&#x2F;" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;videos&#x2F;play&#x2F;wwdc2015&#x2F;408&#x2F;</a>
评论 #34683422 未加载
dagmxover 2 years ago
I recommend starting with 100 days of SwiftUI. <a href="https:&#x2F;&#x2F;www.hackingwithswift.com&#x2F;100&#x2F;swiftui" rel="nofollow">https:&#x2F;&#x2F;www.hackingwithswift.com&#x2F;100&#x2F;swiftui</a><p>Despite the name, it’s quite fast to get through.<p>Apple also has really great videos on life cycles etc <a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;wwdc21&#x2F;10022" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;wwdc21&#x2F;10022</a> that go over the underpinnings
uhuraover 2 years ago
This might not be a popular opinion but it was what worked for me: - Research a little about PostScript and the display version. - NextStep Developer Documentation [1] - Apple older documentation (it is archived, but covered a lot of stuff)<p>Why this instead of a book? MacOS X UI is the result of many years of experiment and technologies. Going over the historical view gave me time to build a mental framework to work on instead of pushing things as they are today. MacOS is also changing so much that the documentation gap only gets worse with time.<p>Storyboards, SwiftUI, iOS, UIKit are noisy in that sense because they solve problems that you might not understand from the get go.<p>Understanding Objective-C is also crucial because besides SwiftUI, the backbone was made with Objective-C characteristics in mind. But this one I don’t have good references for besides Smalltalk books and Clang documentation.<p>[1] <a href="http:&#x2F;&#x2F;www.nextcomputers.org&#x2F;NeXTfiles&#x2F;Docs&#x2F;NeXTStep&#x2F;3.3&#x2F;nd&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.nextcomputers.org&#x2F;NeXTfiles&#x2F;Docs&#x2F;NeXTStep&#x2F;3.3&#x2F;nd&#x2F;</a>
alexashkaover 2 years ago
Do a little iOS dev since that has 100x more learning resources.<p>Once you grok iOS, you&#x27;ll be at home with macOS since they follow the same patterns.<p>Stick with storyboards, don&#x27;t bother with SwiftUI (no, really, don&#x27;t do it) and try to use as much default out of the box behaviour as possible, instead of wondering &#x27;how do I do that X thing I did on platform Y&#x27;.
评论 #34682896 未加载
lapcatover 2 years ago
A couple years ago I wrote a blog post &quot;Resources for learning Objective-C and AppKit&quot;. I wouldn&#x27;t say it&#x27;s comprehensive, but it may be useful. <a href="https:&#x2F;&#x2F;lapcatsoftware.com&#x2F;articles&#x2F;learning.html" rel="nofollow">https:&#x2F;&#x2F;lapcatsoftware.com&#x2F;articles&#x2F;learning.html</a>
andrewmcwattersover 2 years ago
Apple Developer Documentation Archive. <a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;library&#x2F;archive&#x2F;navigation&#x2F;" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;library&#x2F;archive&#x2F;navigation&#x2F;</a><p>It&#x27;s filled with the specific type of knowledge you&#x27;re looking for.
评论 #34681138 未加载
评论 #34682312 未加载
programmarchyover 2 years ago
Highly recommend beginning with Swift and using SwiftUI for UI development. Dive into AppKit and Obj-C when (if) necessary. As an additional companion, check out the HIG [1] or Human Interface Guidelines. It&#x27;s a great starting point for introducing a feature &quot;the Apple way&quot;, and it&#x27;ll make knowing what to reach for in SwiftUI much more straight forward.<p>[1] <a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;design&#x2F;human-interface-guidelines&#x2F;guidelines&#x2F;overview" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;design&#x2F;human-interface-guideline...</a>
pejrichover 2 years ago
I&#x27;m just finshing up my first macOS app. I went with SwiftUI because I was new and didn&#x27;t want to learn an &quot;old&quot; tech. The reality is outside of very basic stuff, SwiftUI is not capable of doing a lot of stuff, so I ended up have to learn not only AppKit as well, but how to fuse AppKit into SwiftUI and fuse SwiftUI into AppKit.<p>My advice is don&#x27;t be attracted by the shiny toy that is SwiftUI. It&#x27;s a steaming pile to dung, unless you just want some basic forms&#x2F;tables&#x2F;text.
评论 #34682528 未加载
dep_bover 2 years ago
Started a new app last year using Stotyboards and AppKit and haven’t regretted it for a second. I use SwiftUI on iOS devices on a daily basis and I don’t have to dip into UIKit very often anymore, but AppKit on macOS was always more mature than UIKit let alone SwiftUI. Plus SwiftUI still has rough spots on macOS.<p>If you want to go for the typical macOS look &amp; feel stick with AppKit.<p>Resources: barely any<p>Apparently you’re either not interested in macOS development or you’re way too experienced to need help.
bombcarover 2 years ago
The other responses have some great answers, but I learn best by breaking something that is already working, and so this list may have useful sources of code to poke around in: <a href="https:&#x2F;&#x2F;github.com&#x2F;serhii-londar&#x2F;open-source-mac-os-apps">https:&#x2F;&#x2F;github.com&#x2F;serhii-londar&#x2F;open-source-mac-os-apps</a>
评论 #34686142 未加载
devwastakenover 2 years ago
Be aware any application you distribute must be signed now, or gatekeeper will not allow it to run. This means you must pay the $100 yearly apple developer fee, apple wants to make sure you&#x27;re not economically disadvantaged. There are no exceptions even for students or open source. Only a licensed nonprofit may be able to waive it.
poulsbohemianover 2 years ago
It&#x27;s really too bad there isn&#x27;t a modern equivalent of the Inside Macintosh books. Those were amazing.
not_me_everover 2 years ago
Apple has tons of videos on their developer portal. <a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;videos&#x2F;all-videos&#x2F;" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;videos&#x2F;all-videos&#x2F;</a><p>Usually a good primer for any topic you want to dive into.
TazeTSchnitzelover 2 years ago
There is a lot of excellent documentation on Apple&#x27;s website, but it&#x27;s all in the “documentation archive” and is at least five years out of date. Please read it anyway! There&#x27;s great conceptual introductions to every topic you could imagine in there.
alvivancoover 2 years ago
I found this course with great ratings while browsing on Udemy this weekend:<p><a href="https:&#x2F;&#x2F;www.udemy.com&#x2F;course&#x2F;professional-macos-programming&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.udemy.com&#x2F;course&#x2F;professional-macos-programming&#x2F;</a>
评论 #34681270 未加载
rock3mover 2 years ago
Building macOS apps is a lot easier with SwiftUI now. This book has quite a few good examples - <a href="https:&#x2F;&#x2F;www.amazon.com&#x2F;dp&#x2F;B0BP5P9H31" rel="nofollow">https:&#x2F;&#x2F;www.amazon.com&#x2F;dp&#x2F;B0BP5P9H31</a>
tooltitudeover 2 years ago
I found the books about Apple technologies by this collective to be very good: <a href="https:&#x2F;&#x2F;www.objc.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.objc.io&#x2F;</a>
innocentoldguyover 2 years ago
I found Paul Hudson&#x27;s &quot;Hacking with Swift&quot; products quite useful.<p><a href="https:&#x2F;&#x2F;www.hackingwithswift.com" rel="nofollow">https:&#x2F;&#x2F;www.hackingwithswift.com</a>
nocsiover 2 years ago
The most bang for your buck is to watch the latest WWDC videos. Use SwiftUI to hit the road and fill the gaps later. Declarative UI is too powerful and removes a lot of the excuses people had before in UI development. There’s different technologies you’re going to encounter that are the same as Windows-land, but has the Apple branding.
dinkblamover 2 years ago
shamelessly off-topic but if anyone here is already good at Objective-C development for macOS and looking for remote work, please drop us a line at: jobs@corecode.io
评论 #34684028 未加载