Skip to content

[AppKit] Add bindings for the new APIs in Xcode 27. - #25777

Merged
dalexsoto merged 11 commits into
xcode27.0from
dev/alex/xc27-appkit
Jun 29, 2026
Merged

[AppKit] Add bindings for the new APIs in Xcode 27.#25777
dalexsoto merged 11 commits into
xcode27.0from
dev/alex/xc27-appkit

Conversation

@dalexsoto

Copy link
Copy Markdown
Member

Bind the missing AppKit APIs reported by xtro for Xcode 27, emptying macOS-AppKit.todo and MacCatalyst-AppKit.todo.

New types: NSViewCornerRadius, NSViewCornerConfiguration, NSViewCornerRadii, NSRefreshController, NSStatusItemExpandedInterfaceSession and NSTextSelectionManager.

New protocols: NSStatusItemExpandedInterfaceDelegate, NSTextSelectionManagerDelegate and the NSTextViewportRenderingSurface / NSTextViewportRenderingSurfaceKey marker protocols.

New enums: NSControlEvents, NSMenuItemImageVisibility, NSScreenTouchCapabilities, NSSegmentedControlRole, NSTextSelectionMode, NSToolbarItemGroupRole, NSTextAttachmentViewProviderReusePolicy, NSViewExclusiveGestureBehavior and the NSApplicationPresentationDisableScreenCornerInteractions option.

New members on NSView, NSControl, NSScrollView, NSScreen, NSMenuItem, NSSegmentedControl, NSStatusItem, NSTextView, NSTextBlock, NSBrowserDelegate, NSGestureRecognizer, NSPanGestureRecognizer, NSGlassEffectView and NSEvent, plus the new NSTextAlignmentToCTTextAlignment / NSTextAlignmentFromCTTextAlignment P/Invokes (covered by a new monotouch-test).

Also deprecate NSPanGestureRecognizer.NumberOfTouchesRequired, fix the nullability of the new NSView corner properties, NSStatusItem.ExpandedInterfaceSession and NSTextBlock.DrawBackground, and make NSPaperMarginDocumentAttribute available on macOS.

The shared TextKit changes in xkit.cs (NSTextLayoutManagerDelegate, NSTextLocation, NSTextLayoutFragment and NSTextViewportLayoutControllerDelegate) also resolve the equivalent entries in the iOS, tvOS and Mac Catalyst UIKit .todo files.

Bind the missing AppKit APIs reported by xtro for Xcode 27, emptying
macOS-AppKit.todo and MacCatalyst-AppKit.todo.

New types: NSViewCornerRadius, NSViewCornerConfiguration, NSViewCornerRadii,
NSRefreshController, NSStatusItemExpandedInterfaceSession and
NSTextSelectionManager.

New protocols: NSStatusItemExpandedInterfaceDelegate,
NSTextSelectionManagerDelegate and the NSTextViewportRenderingSurface /
NSTextViewportRenderingSurfaceKey marker protocols.

New enums: NSControlEvents, NSMenuItemImageVisibility, NSScreenTouchCapabilities,
NSSegmentedControlRole, NSTextSelectionMode, NSToolbarItemGroupRole,
NSTextAttachmentViewProviderReusePolicy, NSViewExclusiveGestureBehavior and the
NSApplicationPresentationDisableScreenCornerInteractions option.

New members on NSView, NSControl, NSScrollView, NSScreen, NSMenuItem,
NSSegmentedControl, NSStatusItem, NSTextView, NSTextBlock, NSBrowserDelegate,
NSGestureRecognizer, NSPanGestureRecognizer, NSGlassEffectView and NSEvent, plus
the new NSTextAlignmentToCTTextAlignment / NSTextAlignmentFromCTTextAlignment
P/Invokes (covered by a new monotouch-test).

Also deprecate NSPanGestureRecognizer.NumberOfTouchesRequired, fix the
nullability of the new NSView corner properties, NSStatusItem.ExpandedInterfaceSession
and NSTextBlock.DrawBackground, and make NSPaperMarginDocumentAttribute available
on macOS.

The shared TextKit changes in xkit.cs (NSTextLayoutManagerDelegate, NSTextLocation,
NSTextLayoutFragment and NSTextViewportLayoutControllerDelegate) also resolve the
equivalent entries in the iOS, tvOS and Mac Catalyst UIKit .todo files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the AppKit (and shared TextKit) bindings to cover the newly introduced APIs in Xcode 27, and updates the xtro-sharpie .todo/.ignore lists plus test coverage to reflect the new surface area.

Changes:

  • Added new AppKit bindings (types/protocols/enums/members) for Xcode 27, including corner configuration APIs, refresh controller, status item expanded interface, new control/menu/screen enums, and additional selectors.
  • Added shared TextKit protocol bindings and updated introspection skipping for an Xcode 27 runtime/header mismatch.
  • Updated xtro-sharpie todo/ignore files and added a new monotouch-test validating NSTextAlignment ↔ CTTextAlignment conversion P/Invokes.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/xtro-sharpie/api-annotations-dotnet/tvOS-UIKit.todo Removes resolved TextKit-related todo entries.
tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.todo Emptied by binding the missing AppKit APIs (file removed).
tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore Adds ignores for NSTextLocation required-member abstractness deferral.
tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-UIKit.todo Removes resolved TextKit-related todo entries.
tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-AppKit.todo Emptied by binding the missing AppKit APIs (file removed).
tests/xtro-sharpie/api-annotations-dotnet/iOS-UIKit.todo Removes resolved TextKit-related todo entries.
tests/xtro-sharpie/api-annotations-dotnet/common-UIKit.ignore Adds ignores for NSTextLocation required-member abstractness deferral.
tests/monotouch-test/AppKit/NSTextAlignmentConversionTest.cs New test validating NSTextAlignment/CTTextAlignment conversion wrappers.
tests/introspection/ApiProtocolTest.cs Skips a known Xcode 27 runtime mismatch for marker protocol conformance.
tests/cecil-tests/Documentation.KnownFailures.txt Adds doc known-failure entries for newly bound enum values/members.
src/xkit.cs Adds shared TextKit protocol members and marker protocols (viewport rendering surface/key).
src/AppKit/Functions.cs Adds P/Invoke wrappers for NSTextAlignment ↔ CTTextAlignment conversion functions.
src/AppKit/Enums.cs Adds NSApplicationPresentationOptions.DisableScreenCornerInteractions.
src/appkit.cs Adds new AppKit bindings (NSControlEvents, NSRefreshController, status item expanded interface, corner APIs, etc.).

Comment thread src/appkit.cs
Comment on lines +18496 to +18499
[Mac (27, 0), NoMacCatalyst]
[BaseType (typeof (NSObject))]
interface NSStatusItemExpandedInterfaceSession {
[Export ("cancel")]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dalexsoto the [DisableDefaultCtor] might be valid here (the removal of [Export ("cancel")] obviously isn't)

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Comment thread src/xkit.cs Outdated
Comment thread src/appkit.cs
Comment on lines +6054 to +6060
[Mac (11, 0)]
[Export ("addTarget:action:forControlEvents:")]
void AddTarget ([NullAllowed] NSObject target, Selector action, NSControlEvents controlEvents);

[Mac (11, 0)]
[Export ("removeTarget:action:forControlEvents:")]
void RemoveTarget ([NullAllowed] NSObject target, [NullAllowed] Selector action, NSControlEvents controlEvents);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be done in a separate PR if we decide to do it: having a delegate API would be more C#-like:

void AddTarget (Action action, NSControlEvents controlEvents);
void RemoveTarget (Action action, NSControlEvents controlEvents);

or maybe something like this, where disposing of the return value removes the target:

IDisposable AddTarget (Action action, NSControlEvents controlEvents);

Comment thread src/appkit.cs Outdated
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

* Make NSTextLocation's isEqual: and hash unconditionally [Abstract] instead
  of gating [Abstract] behind XAMCORE_5_0 (adding [Abstract] to a protocol
  member is no longer a breaking change), and drop the now-unnecessary
  incorrect-protocol-member xtro ignore entries.

* Rename the new NSTextBlock 'widthValueTypeForLayer:rectEdge:' binding from
  WidthValueTypeForLayer to GetWidthValueType to follow .NET naming
  conventions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

❌ [CI Build #a9b9861] Prepare .NET Release failed ❌

The following jobs reported a non-successful result:

Job Result
Sign NuGets ✅ Succeeded
Convert NuGet to MSI ✅ Succeeded
Push NuGets ❌ Failed
📦 Signed NuGet packages (32 packages)

iOS

  • Microsoft.iOS.Ref.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.iOS.Runtime.ios-arm64.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.iOS.Runtime.ios.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.iOS.Runtime.iossimulator-arm64.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.iOS.Runtime.iossimulator-x64.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.iOS.Sdk.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.iOS.Templates.27.0.10099-xcode27.0.nupkg
  • Microsoft.iOS.Windows.Sdk.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.NET.Sdk.iOS.Manifest-10.0.400-preview.0.27.0.10099-xcode27.0.nupkg

MacCatalyst

  • Microsoft.MacCatalyst.Ref.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.MacCatalyst.Runtime.maccatalyst-arm64.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.MacCatalyst.Runtime.maccatalyst-x64.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.MacCatalyst.Runtime.maccatalyst.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.MacCatalyst.Sdk.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.MacCatalyst.Templates.27.0.10099-xcode27.0.nupkg
  • Microsoft.NET.Sdk.MacCatalyst.Manifest-10.0.400-preview.0.27.0.10099-xcode27.0.nupkg

macOS

  • Microsoft.macOS.Ref.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.macOS.Runtime.osx-arm64.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.macOS.Runtime.osx-x64.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.macOS.Runtime.osx.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.macOS.Sdk.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.macOS.Templates.27.0.10099-xcode27.0.nupkg
  • Microsoft.NET.Sdk.macOS.Manifest-10.0.400-preview.0.27.0.10099-xcode27.0.nupkg

tvOS

  • Microsoft.NET.Sdk.tvOS.Manifest-10.0.400-preview.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.tvOS.Ref.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.tvOS.Runtime.tvos-arm64.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.tvOS.Runtime.tvos.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.tvOS.Runtime.tvossimulator-arm64.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.tvOS.Runtime.tvossimulator-x64.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.tvOS.Sdk.net10.0_27.0.27.0.10099-xcode27.0.nupkg
  • Microsoft.tvOS.Templates.27.0.10099-xcode27.0.nupkg

Other

  • Sharpie.Bind.Tool.27.0.0.99-xcode27.0.nupkg

Pipeline on Agent
Hash: a9b9861f7786d59605846010cd29373b7fa34c2e [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

…adii.

The macOS 27 runtime conforms NSViewCornerRadii to NSCoding and
NSSecureCoding, but the Xcode 27 beta 2 SDK header declares only
'NSViewCornerRadii : NSObject <NSCopying>'. Since the conformance is not
declared in the headers, skip the Coding and SecureCoding introspection
checks for this type; the binding stays faithful to the header
(NSCopying only).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

…rnerRadii.

The previous commit added the NSViewCornerRadii exclusion intended for
NSSecureCoding into the adjacent NSCopying switch block by mistake, so the
SecureCoding introspection test still failed on macOS 27 (while Coding
passed). Move the exclusion into the correct NSSecureCoding block, and drop
the stray NSCopying entry so NSViewCornerRadii's legitimate INSCopying
conformance keeps being tested.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #4f95070] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 4f95070e0449e514463e1b1a4f73d6e6e6b7fb73 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #4f95070] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 4f95070e0449e514463e1b1a4f73d6e6e6b7fb73 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 4f95070e0449e514463e1b1a4f73d6e6e6b7fb73 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #4f95070] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 4f95070e0449e514463e1b1a4f73d6e6e6b7fb73 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #4f95070] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 196 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 18 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 17 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 18 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Golden Gate (27): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 4f95070e0449e514463e1b1a4f73d6e6e6b7fb73 [PR build]

@dalexsoto
dalexsoto requested a review from rolfbjarne June 29, 2026 13:15
@rolfbjarne

Copy link
Copy Markdown
Member

/review

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

.NET for Apple Platforms PR Reviewer completed successfully!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Review Complete

This PR adds comprehensive AppKit bindings for Xcode 27, including new types, protocols, and members across multiple frameworks. The changes follow the repository's binding conventions well. CI is green ✅ — all tests passed.

Summary

  • New types: 8 (NSViewCornerRadius, NSViewCornerConfiguration, NSViewCornerRadii, NSRefreshController, NSStatusItemExpandedInterfaceSession, NSTextSelectionManager, and protocols)
  • New enums: 9 (NSControlEvents, NSMenuItemImageVisibility, NSScreenTouchCapabilities, NSSegmentedControlRole, NSTextSelectionMode, NSToolbarItemGroupRole, NSTextAttachmentViewProviderReusePolicy, NSViewExclusiveGestureBehavior, plus enum value)
  • New members: ~100+ across NSView, NSControl, NSScrollView, NSScreen, NSMenuItem, NSSegmentedControl, NSStatusItem, NSTextView, NSTextBlock, NSBrowserDelegate, NSGestureRecognizer, NSPanGestureRecognizer, NSGlassEffectView, NSEvent, and TextKit shared types

What's Good

✅ Platform availability attributes are consistently applied
[NullAllowed] is correctly used for nullable parameters and return values
✅ Deprecated API (NSPanGestureRecognizer.NumberOfTouchesRequired) correctly marked with [Deprecated] and replacement provided
✅ Shared TextKit protocol changes (NSTextLayoutManagerDelegate, NSTextLocation, NSTextLayoutFragment, NSTextViewportLayoutControllerDelegate) correctly resolve .todo entries across iOS, tvOS, and Mac Catalyst
✅ Proper use of ArgumentSemantic for properties
✅ Test exclusions added for known runtime/header discrepancies (NSViewCornerRadii conformance, NSTextLayoutFragment protocol)
✅ All .todo files properly emptied for resolved APIs

Suggestions (💡)

I've posted 8 inline suggestions for minor improvements:

  • Verify platform availability consistency for NSViewCornerRadius vs related types
  • Confirm nullability of NSView.CornerConfiguration (read-only property)
  • Check if NSRefreshController and NSStatusItemExpandedInterfaceSession need constructors
  • Verify ArgumentSemantic.Assign usage for NSTextSelectionManager.TextSelectionMode
  • Confirm NSTextLocation.IsEqual allows nil parameter
  • Consider adding documentation for GetNativeHash() method
  • Ensure NSTextView's [RequiresSuper] methods are tested

Issue count: 0 errors ❌ | 0 warnings ⚠️ | 8 suggestions 💡

Great work on a thorough and well-structured binding addition! The bindings follow the repository conventions and the PR description accurately reflects the changes.

Generated by .NET for Apple Platforms PR Reviewer for issue #25777 · 72.2 AIC · ⌖ 10.6 AIC · ⊞ 5.1K
Comment /review to run again

Comments that could not be inline-anchored

src/appkit.cs:346

🤖 💡 Binding definition — NSViewCornerRadius is marked as available on both Mac and MacCatalyst (27, 0), but NSViewCornerConfiguration and NSViewCornerRadii are only marked Mac (27, 0), NoMacCatalyst. This inconsistency should be verified against Apple's headers.

Rule: Platform availability attributes

src/appkit.cs:279

🤖 💡 API design — NSStatusItemExpandedInterfaceSession has only a Cancel() method. Verify if there are any properties (like isActive or lifecycle state) that should be exposed, or if this is intentionally a minimal interface.

Rule: Binding correctness

src/xkit.cs:662

🤖 💡 Protocol binding — The IsEqual method in NSTextLocation protocol is marked [Abstract], which is correct. However, the parameter is [NullAllowed] NSObject anObject. Verify in Apple's headers whether nil is allowed — most isEqual: implementations allow nil for safe comparison, so this looks correct.

Rule: NullAllowed on nullable parameters

src/appkit.cs:482

🤖 💡 Binding definition — NSTextSelectionManager has three separate properties: TextSelectionMode (assign), WeakDelegate (weak), and WeakTextSelectionDataSource (weak). The Wrap properties are correctly generated. Verify that TextSelectionMode should use ArgumentSemantic.Assign — for enums this is typically correct, but double-check the headers.

Rule: ArgumentSemantic for properties

src/xkit.cs:667

🤖 💡 Method naming — The method is named GetNativeHash() to return the hash value. This follows the convention of prefixing property-like accessors with Get to avoid conflicts with the C# GetHashCode() method. Consider documenting why this method exists alongside the standard GetHashCode() to clarify for API consumers.

Rule: Method naming conventions

src/appkit.cs:550

🤖 💡 Testing — NSTextView now implements NSTextViewportLayoutControllerDelegate with five new methods marked with [RequiresSuper] and [Mac (27, 0)]. These are reimplementations (using new) of protocol methods with added attributes. Verify that these overrides are tested, especially the [RequiresSuper] behavior — subclasses must call the base implementation or risk runtime errors.

Rule: Testing

src/appkit.cs:208

🤖 💡 API design — NSRefreshController has no constructor binding. Verify whether this class has a designated initializer or if instances are only created by the framework. If there's a public init or new method in Apple's headers, it should be bound.

Rule: Binding correctness

src/appkit.cs:316

🤖 💡 Binding definition — The CornerConfiguration property on NSView is read-only (no setter), yet it's decorated with [NullAllowed] and ArgumentSemantic.Copy. For read-only properties bound from getters, verify that the property can actually return nil in Apple's documentation. If it's guaranteed non-null, remove [NullAllowed].

Rule: NullAllowed on nullable parameters

@dalexsoto
dalexsoto merged commit c1149a5 into xcode27.0 Jun 29, 2026
55 checks passed
@dalexsoto
dalexsoto deleted the dev/alex/xc27-appkit branch June 29, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants