sfba.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Mastodon instance for the San Francisco Bay Area. Come on in and join us!

Server stats:

2.3K
active users

#AppKit

6 posts4 participants0 posts today

DST change reminded me of that time QA discovered that, if you build a date from NSDateComponents, any missing items will not be set to zero, but will be set to the corresponding value from the current date and time.

Which meant that my March 30th, 12:00 would get random one-minute-drift like 12:00:59 because the user entered the date right before a minute change.

Makes sense for the date, but was a bit bewildering for the time, especially seconds.

It’s kind of strange that if you have several NSToolbars in your app and the user customizes the display mode in one of them to, say, “Icon and Text” this state does not sync to all of the app’s toolbars. There also doesn’t seem to be any obvious way to observe changes to these settings. I guess that’s just okay and the user is expected to customize them all separately..?

Or I wait until next WWDC and our Mac windows won’t have toolbars anymore as they have been designed for “the next generation of users”.

#AppKit #UIKit #CollectionView

Any (NS/UI)CollectionView fans here? I’m trying to make a good collection view UI. It is just a simple flat scrolling column of things, should be simple layout.

I want the cells to size themselves to the SwiftUI content in them, which they almost do, but not when I resize the window and things start to wrap differently.

What am I missing? How should I make the heights respond better to window resizing?

Code: gist.github.com/jaanus/66e3d86

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!

humancode.us/2023/07/08/all-ab

humancode.usAll about Item ProvidersThe NSItemProvider class in Foundation is a powerful abstraction for making data available across processes that are otherwise isolated from one another. I hope this post can be a one-stop reference for developers who want a solid understanding how item providers work, and how to use the API in a modern way.
#iOS#iOSDev#macOS

I would go even further that the “controllers” in the modern / world are even further away from the original conception of , 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.

collindonnell.com/mvc-isnt-mvc

Collin Donnell · MVC Isn’t MVCIn December of 1979 Tyrgve Reenskaug, an employee of Xerox PARC), published a paper called MODELS-VIEWS-CONTROLLERS about a design patter...