{"id":35074,"date":"2022-02-18T14:33:33","date_gmt":"2022-02-18T19:33:33","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=35074"},"modified":"2022-02-18T14:34:24","modified_gmt":"2022-02-18T19:34:24","slug":"where-mac-catalyst-falls-short","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2022\/02\/18\/where-mac-catalyst-falls-short\/","title":{"rendered":"Where Mac Catalyst Falls Short"},"content":{"rendered":"<p><a href=\"https:\/\/www.highcaffeinecontent.com\/blog\/20220216-Where-Mac-Catalyst-Falls-Short\">Steve Troughton-Smith<\/a> (<a href=\"https:\/\/twitter.com\/stroughtonsmith\/status\/1494055527688687632\">tweet<\/a>):<\/p>\n<blockquote cite=\"https:\/\/www.highcaffeinecontent.com\/blog\/20220216-Where-Mac-Catalyst-Falls-Short\"><p>The biggest glaring hole in UIKit on macOS is its handling of document-based apps. [&#8230;] No Apple app is dogfooding this aspect of Catalyst, and it shows.<\/p><p>[&#8230;]<\/p><p>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 <a href=\"https:\/\/github.com\/steventroughtonsmith\/CatalystPrefsWindow\">sample code<\/a> that demonstrates just that. However, there are still missing pieces[&#8230;]<\/p><p>[&#8230;]<\/p><p>The number one user request in my apps, and the number one topic I&rsquo;ve been asked about from developers over the past two years, is all about putting UI in the menu bar.<\/p><p>[&#8230;]<\/p><p>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&rsquo;t give you a table view that works as expected on macOS. You&rsquo;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&rsquo;t have the mechanics to understand the distinction between a click, double-click, touch, keyboard trigger, or stylus touch &mdash; they&rsquo;re all just &lsquo;a selection&rsquo;.<\/p><p>[&#8230;]<\/p><p>Unfortunately, only a subset of NSToolbar-related functionality is bridged, which means you&rsquo;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.<\/p><p>[&#8230;]<\/p><p>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.<\/p><p>[&#8230;]<\/p><p>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&rsquo;re really left out to dry here.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Steve Troughton-Smith (tweet): The biggest glaring hole in UIKit on macOS is its handling of document-based apps. [&#8230;] No Apple app is dogfooding this aspect of Catalyst, and it shows.[&#8230;]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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2022-02-18T19:33:36Z","apple_news_api_id":"47ffa41a-6789-4973-9a18-c64ae87a3b0f","apple_news_api_modified_at":"2022-02-18T19:34:28Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/AR_-kGmeJSXOaGMZK6Ho7Dw","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[1621,69,30,2077,71],"class_list":["post-35074","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-marzipan","tag-cocoa","tag-mac","tag-macos-12","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/35074","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=35074"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/35074\/revisions"}],"predecessor-version":[{"id":35075,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/35074\/revisions\/35075"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=35074"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=35074"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=35074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}