I feel like Apple got rid of NSDrawer because it would pretty much break with full-screen functionality... at least this is my thinking.
But they could have kept them for apps that don't support full screen and have a max size much smaller than the size of your display. They're still hella useful and cute.
Probably one of my fave "fine tuning" APIs in #AppKit that I just love: acceptsFirstMouse(for:)
This is great for unintended actions that might happen if your users clicks somewhere in a window to bring it to the forefront but might have clicked a control.
Example: Mail overrides this for the Delete button. If Mail is in the background, if you click over the Delete button to bring it forward, it brings Mail to the front but the button will ignore that initial click.
Achievement: improved UI responsiveness by not iterating over NSTreeController.children (that seemed to be super slow) but over the underlying data that fuel the tree controller. That was not an obvious fix, and not noticeable on small tree #appkit
Please remember that it is a beta, so it is a work-in-progress and expect some bugs here and there. Some features are not fully implemented and I am aware of some of them and probably forgot others. 🤭
Is there really no equivalent to NSColor(named:, bundle:) for UIColor? How do I load a UIColor from a specific Asset Catalog associated with my framework bundle?
I’ve been working on a new macOS app, it’s a Mastodon client! I started it in January and went full development from July onwards. The client is made specifically for the Mac, conforming to the design language very seriously. I aim to make it a true Mac app with platform-specific features. Here is a screenshot, what do you think?
After my pro-#SwiftUI rant earlier today, I went into the opposite direction -- instead of denying reality, I found a small thing that was quite ok once I stopped fighting the old ways again:
I've decided to take the old #Macintosh HIGs & merge them into one large collection of topics while modernizing them in the process.
The original #HIG would give actual examples w/ usable metrics & mention possible exceptions to the rule. The incredible level of detail gave developers the guidance to create delightful UI users have come to expect from their #Mac.
Argh… so I wasted 2+ hours and a lot of mental energy just to discover that NSTabViewController doesn't do the crossfade animation that's enabled on the storyboard, because that checkbox just doesn't work and it works fine if I simply set that same property in code… yay #AppKit#MacDev 😑
(If you tell me I should not be building the UI with storyboards, I will turn into a gremlin 👿)
So, thirty-thousand print calls later, I get far along enough that the UI I’m trying to preview… briefly flashes then disappears.
The print calls suggest that my view controller gets instantiated multiple times, and I’m guessing that causes a race condition with the callbacks that ultimately fill a table view inside the view with data.
I might also be implementing NSViewControllerRepresentable wrong?
(Also, it appears I can only use the new Preview macro if I target macOS 14?)
The 17 part series is complete! This was was such fun to make, and I want to thank @_inside for joining me! 💜
This series covers using #SwiftUI and #AppKit together to build a "real” app. It includes networking, JSON parsing, windowing, SwiftUI lifecycle, integration with NSViewRepresentable, keyboard shortcuts and much more!