Repository navigation
Conversation
…SObject category The UIImage selectors were declared as a category on NSObject, which adds them to NSObject and NSImage for every translation unit that sees the header. Declare a protocol and cast to it at the call sites instead. The class lookup now also honours the requested system (NSImage for AppKit, UIImage otherwise) and is no longer cached in statics. (cherry picked from commit 9a67fb2)
|
Cold review: FIX-NEEDED on wording, now fixed in the PR title and body: this is a behaviour fix (macOS with a non-AppKit system now selects UIImage), not a pure refactor. Code otherwise reads correct (system is a parameter in scope). Not compiled. |
|
Thanks for pointing out the selector typing in Replacing the We've picked up the typed protocol improvement in #1277 while keeping the |
Summary
RFC, draft, unbuilt.
system(NSImage for AppKit, UIImage otherwise) instead of caching one class in statics.Impact to review: on macOS with a non-AppKit
systemthe class changes from NSImage to UIImage, which fixes an unrecognized-selector path but raises if UIKit is not loaded. iOS and visionOS only lose the cache.Verification
Run: the commit cherry-picks cleanly onto current main; a cold review read the call sites. Not run: no compiler was available, so this was not compiled. CONTRIBUTING.md asks for an issue first for large work; this is one concern. Related RFC draft: #1246.