Skip to content

Comment on Ask HN: I want to make a native UI for macOS. What do I use?parent

Comments

Your answer is correct. Swift & AppKit is what you should use for a native macOS app today.

Only one thing to add: Embrace the fact that Swift and Objective C are compatible! Some parts are way easier to write in Objective C, eg. anything that interfaces with C code.

Also, if your app does non-trivial amounts of text editing, those parts should probably be written in Objective C.

Working with NSTextView / NSString / NSMutableString / NSAttributedString in Swift is difficult. You always need to be super careful not to mix up Objective C characters (UTF-16) with Swift characters ("Grapheme clusters"). Even as someone who read a lot about those topics it's easy to mix them up. It's also easy to run into catastrophic performance problems, eg. checking large strings for equality is really slow in Swift, and can easily lead to UI hangs.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.