Friday, February 18, 2022 [Tweets] [Favorites]

Where Mac Catalyst Falls Short

Steve Troughton-Smith (tweet):

The biggest glaring hole in UIKit on macOS is its handling of document-based apps. […] No Apple app is dogfooding this aspect of Catalyst, and it shows.


If you dig in, you will find that Catalyst gives you all the tools you need to build a settings window using the UIKit window scene APIs. I have sample code that demonstrates just that. However, there are still missing pieces[…]


The number one user request in my apps, and the number one topic I’ve been asked about from developers over the past two years, is all about putting UI in the menu bar.


While I appreciate the new configuration APIs added to UICollectionView to perform the function of a regular table view, unfortunately by default they just don’t give you a table view that works as expected on macOS. You’ll be hundreds of lines in just trying to match the basic behavior one might expect from an AppKit NSTableView, with selection and inactive states, and completely on your own when it comes to type-select or more-esoteric AppKit-wide keyboard shortcuts. Beyond that, UICollectionView in general just doesn’t have the mechanics to understand the distinction between a click, double-click, touch, keyboard trigger, or stylus touch — they’re all just ‘a selection’.


Unfortunately, only a subset of NSToolbar-related functionality is bridged, which means you’ll have to start using your own AppKit bridge if you need things like a search field, for example, or custom-drawn views like a Safari-style URL field, volume slider, or where you want a manually-specified fixed size.


Inspector panels was one aspect of AppKit bridging that was originally touted, unofficially, as an option for Catalyst developers. However, there just simply is no way to get UIKit-based content in such a panel window.


However, beyond the most basic changes to padding in Interface Builder and SwiftUI, your layout is going to need a ton of work to be able to run in both [idiom/scaling] modes without a million ifdefs, and you’re really left out to dry here.

1 Comment

... or maybe we could just admit defeat now? I mean if Podcasts is (their) idea of a great Catalyst app, then we may as well just pack up and go home. Exemplary, certainly. And I'll concede that for certain kinds of "information-centric" apps or front-ends to websites, sure, it is probably preferable to a web view. But in my experience Catalyst is just mediocre in the extreme and its only virtue is that it's not Electron. Maybe you have to be a heavy keyboard user, I dunno, but the only Catalyst app I actually enjoy using on my Mac is lire. And even that is let down by the misbehaviour of embedded web views.

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment