I would go even further that the “controllers” in the modern #AppKit / #UIKit world are even further away from the original conception of #MVC, and they’re hardly “controllers” in the original sense any more.
A Window Controller (AppKit) and View Controller (AppKit/UIKit) are tightly coupled to a specific Window or View, so much so that they are basically one and the same—no architectural advantage is lost by combining the Window Controller with its window; or the View Controller with its View.
I’ve always argued that the distinction between Views and View Controllers are quite arbitrary. VCs are used to house lots of functionality that regular Views don’t have—but you could have achieved the same by declaring a View subclass that conforms to the additional protocol, and doing away with the view-creation logic, couldn’t you?
IMO, the “MVC” in UIKit has no controller at all, when you think about it.
Here it is: A comprehensive look at NSItemProvider: what it does, how it works, and how to use it properly. I want this to be a one-stop-shop reference for anyone using this class in their projects.
NSItemProvider is a key class in iOS and Mac Catalyst, used in everything from Drag and Drop, to Pasteboard, share sheet, and beyond. Understanding how this class works will help you make better apps and gain insight into what the system does for you.
Please read the post, and send me feedback. Share it with your iOS developer friends. Let me know what you think!
Anyone use https://github.com/tuist/tuist in lieu of a native .xcodeproj? I mainly ask because git merge flows are painful with the latter format. Too many conflicts that result from irrelevant internals.
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. 🤭
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.
#MacDev#AppKit question: if I have a main storyboard set in Info.plist, and an initial (entry point) window controller in that storyboard (with "single presentation"), so like in the Mac app Xcode template, the storyboard automatically creates the window controller and its window and displays it; can I get a reference to that controller from AppDelegate somehow? (Calling instantiateInitialController creates a second window controller for some reason…) 🤨
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.
macOS Sonoma AppKit + SwiftUI introduced a new API for Split View Controllers where the trailing sidebar is can have an "inspector" style -- like Xcode. I just introduced it to my app with minimal change to adopt the new full-height look. This is what it looks like:
I wonder, is there a built-in AppKit/SwiftUI component that lets you show a folder structure like this? Or do you have to create a custo one? I can't think of a way to look this up 🤔
I noticed some inconsistency in #macOS text selection behavior. If I have some text selected and I shift-click before the selection, the selection start point moves to the clicked point. But in some places, the end point also moves to the previous start point.
Try it! Shift-click before some selected text …
Safari address bar: extends selection
Settings search field: replaces selection
Anyone know why?
I thought maybe #SwiftUI vs #AppKit, but after many experiments I don't think so.