Tech

Native macOS SDKs fall short for rich-text chat apps, developer finds

A veteran macOS developer argues that while native tools suit simple screens, web frameworks like Electron and WebKit offer superior text handling and rendering for modern chat applications.

Author
Owen Mercer
Markets and Finance Editor
Published
Draft
Source: Hacker News · original
Tech
No image available
Artem Loenko’s experience with SwiftUI and AppKit highlights the practical advantages of web-based frameworks for complex interfaces

Artem Loenko, a macOS and iOS developer with nearly 20 years of experience, has published findings suggesting that native macOS software development kits are currently inferior to web-based frameworks for building rich-text chat applications. Loenko’s analysis challenges the prevailing industry preference for a "native all the way" approach, arguing that tools such as SwiftUI, AppKit, and TextKit lack the robust text handling and streaming capabilities required for complex, chat-heavy interfaces.

Loenko’s conclusion stems from a recent implementation of a chat interface with Markdown support using pure Swift and SwiftUI. While he acknowledged that native tools offer reasonable performance for simple screens with limited scrolling, he encountered significant technical hurdles when attempting to implement features standard in modern applications. Specifically, the native primitives did not allow for the selection of entire Markdown documents by design, forcing a pivot to other frameworks that introduced new complications.

The developer reported that moving to NSTextView and TextKit 2 resulted in a loss of testing and performance work established in SwiftUI, as the frameworks do not play well together. Attempts to stream text responses into these native views triggered CPU spikes, while switching to AppKit and NSCollectionView led to visual glitches, such as blinking cells. Loenko noted that even lower-level implementations with pure TextKit 2 suffered from poor streaming performance and incompatibility with modern development practices.

In contrast, Loenko found that WebKit rendered Markdown with good performance and near-perfect typography, providing a proper level of control. However, he identified Electron as the most comprehensive solution, offering out-of-the-box support for text operations, Markdown rendering, and macOS integrations. He highlighted that Electron allowed for the easy rendering of complex elements, such as Git diffs, with performance that surpassed his pure TextKit 2 prototypes.

Loenko emphasised that achieving feature parity for basic native behaviours, including context menus, dictionary lookup, and accessibility, would require months of development time. He concluded that for applications relying on long-form rich text and flexible typography, web-based frameworks are currently more practical. While Swift remains valuable for performance-critical tasks, the native SDKs are becoming constraints rather than advantages in this specific domain.

Continue reading

More from Tech

Read next: The Verge reviews Oddity as tense precursor to Hokum
Read next: Eclipse Ventures Realises $2.5 Billion Return on Cerebras Systems IPO
Read next: Fujifilm slashes X Half camera price to $549.99 in limited-time promotion