Live data from Hacker News

Ask HN: Resources to Learn macOS Development?

news.ycombinator.com

21–30 of 91 posts

Re: Ask HN: Resources to Learn macOS Development?

#21
post #14

If you're not writing command line programs (99% of what I do) I suggest adopting SwiftUI for your interface. It's Apple's future for cross platform (ios/macos/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't want that; you just want to interact with your own code. And SwiftUI w…

What sort of complex things are they unable to do? Is there any recourse? Can you use SwiftUI for the majority and dip into something lower level when needed?

SwiftUI's weakness on macOS and to a lesser degree iOS is that it's difficult to fine-tune things to the extent that many longtime Apple platform devs traditionally have. It can usually meet the base case but it makes honing in on the fine details and achieving a high level of polish cumbersome.

There's also some things, particularly on macOS, that you're going to need to drop down into AppKit to do, which is possible thanks to NSViewRepresentable/UIViewRepresentable, but a bit frustrating is necessary.

Personally speaking I'm still limiting usage of SwiftUI to views that are either simple or don't have much in the way of user interaction. It's decent at that, but for most other things I'm using plain old AppKit/UIKit. SwiftUI is still green compared to AppKit/UIKit's multi-decade legacy, so hopefully it will improve in the coming years.

Re: Ask HN: Resources to Learn macOS Development?

#22

"I am looking for explanations that will help me build a conceptual understanding of macos UI development." it depends on your learning style of course, but if you like lecture / course-style learning, i highly recommend paul hegarty's CS193P, it will definitely give you the in-depth, conceptual explanations you're describing. while it is an iOS dev course (taught at stanford, lectures are freely offered online), the…

+1. I just finished up going through this course, and found it very well-taught. Bonus points, the projects are actually pretty fun and cover quite a lot of ground.

Re: Ask HN: Resources to Learn macOS Development?

#23
post #14

If you're not writing command line programs (99% of what I do) I suggest adopting SwiftUI for your interface. It's Apple's future for cross platform (ios/macos/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't want that; you just want to interact with your own code. And SwiftUI w…

Yeah, macOS development is in a tricky spot at the moment: Apple has signaled that SwiftUI is the future, and so starting out with ObjC/Cocoa is making yourself obsolete right from the get-go, but SwiftUI is not production-ready yet and doing anything serious with it is difficult if not impossible. Presumably in a few more years the wrinkles will be ironed out of SwiftUI, but right this instant is unfortunately a cru…

I wouldn't worry too much about AppKit going anywhere any time soon. It's probably in a similar position to where Objective-C is, where it's not receiving a whole lot of additions/iterations, but it'll stick around for years to come because of how much of the OS and how many third party apps still rely on it. It's a good idea to become familiar with SwiftUI but I think Cocoa is in a much better position than say Carbon was several years ago.

Re: Ask HN: Resources to Learn macOS Development?

#24
post #14

If you're not writing command line programs (99% of what I do) I suggest adopting SwiftUI for your interface. It's Apple's future for cross platform (ios/macos/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't want that; you just want to interact with your own code. And SwiftUI w…

What sort of complex things are they unable to do? Is there any recourse? Can you use SwiftUI for the majority and dip into something lower level when needed?

To give a quick example: in swiftui for ios, you can not change the spacing between list sections

Re: Ask HN: Resources to Learn macOS Development?

#25
post #8

Paul Hudson has a decent book on macOS programming using SwiftUI and AppKit. It isn't perfect but it is a decent place to start https://www.hackingwithswift.com/store/hacking-with-macos

Is it as in depth as OP appears to be looking for? I've found Paul's content to be good for quick references to high level concepts, and brief how-tos for beginners, but I've not found it to be good for deeper explorations. That said, I haven't read this book, only his free content.

Good question. It, like all of Paul's books, is more of a series of tutorials than a reference.

I would say it is a decent place to learn how to get started with macOS app developing using either SwiftUI or AppKit. For somebody with no knowledge of macOS app development it will put you in a good position to be able to work from Apple's documentation and further learn the platform.

However it is not anywhere near as in depth as something like Petzold's Windows programming books. Although it isn't meant to be anything like Petzold's books so comparing is kinda pointless anyway :)

I bought Paul's books in a decent value (to me) sale a few years ago and I rate them quite highly overall. Much higher than most other self-published programming books.

Re: Ask HN: Resources to Learn macOS Development?

#26

Apple Developer Documentation Archive. https://developer.apple.com/library/archive/navigation/ It's filled with the specific type of knowledge you're looking for.

It's four years out of date and missing the information OP would need for writing apps today.

Re: Ask HN: Resources to Learn macOS Development?

#27
I'm just finshing up my first macOS app. I went with SwiftUI because I was new and didn't want to learn an "old" 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.

My advice is don't be attracted by the shiny toy that is SwiftUI. It's a steaming pile to dung, unless you just want some basic forms/tables/text.

Re: Ask HN: Resources to Learn macOS Development?

#28
post #27

I'm just finshing up my first macOS app. I went with SwiftUI because I was new and didn't want to learn an "old" 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. My advice is don't be attracted by the shiny toy that is SwiftUI. It's a steaming pile to…

It’s probably more productive to mention what about SwiftUI is a “steaming pile of dung”. For most mobile UI, you can spit out a working design faster than w/ AppKit. It doesn’t even have to be one or the other, you can meld both.

What’s the value in talking about SwiftUI being incapable when you don’t mention what you can’t do in it.

Re: Ask HN: Resources to Learn macOS Development?

#29
Apple's Own Developer Documentation is Exceptional ranging from Cookbook-style guides to Reference Documentation.

https://developer.apple.com/documentation/technologies

There are dozens of entrypoints depending on the framework (e.g. SwiftUI, Cocoa, CoreFoundation etc. ) , Platform & Application you are interested in .

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's own framework documentation .

That will give you the e2e experience covering all the tools & frameworks needed to finish the task. Then repeat with a more complicated app or one in a different domain.

Re: Ask HN: Resources to Learn macOS Development?

#30
post #29

Apple's Own Developer Documentation is Exceptional ranging from Cookbook-style guides to Reference Documentation. https://developer.apple.com/documentation/technologies There are dozens of entrypoints depending on the framework (e.g. SwiftUI, Cocoa, CoreFoundation etc. ) , Platform & Application you are interested in . I recommend starting with an application in mind (e.g. a MenuBar Utility, Notification Bar Widget,…

Also seek out similar apps on Github, then "reverse engineer" those into frameworks and read Apple's documentation on the framework
Post reply on HN