Skip to content

[UIKit] Bind new Xcode 27 (iOS 27) UIKit APIs - #25889

Merged
dalexsoto merged 3 commits into
xcode27.0from
dev/alex/xc27UIKit
Jul 1, 2026
Merged

dalexsoto merged 3 commits into
xcode27.0from
dev/alex/xc27UIKit

Conversation

@dalexsoto

Copy link
Copy Markdown
Member

Resolve the UIKit entries in the iOS/tvOS/MacCatalyst .todo files for Xcode 27:

  • NSTextBlock/NSTextTable/NSTextTableBlock + TextKit enums, and enable NSParagraphStyle/NSMutableParagraphStyle.textBlocks on UIKit platforms (remove the dummy NSTextBlock/NSTextTableBlock aliases in xkit.cs).
  • Scene accessories (UISceneAccessory, UISceneAccessoryRegistration), UISceneClosureConfirmation, UISceneConfiguration init/initWithName:, UIWindowScene display-link/closure-confirmation, and the window-scene delegate supportedInterfaceOrientationsForWindowScene:.
  • UIMenuElement/UIMenuLeaf image visibility + highlight handler.
  • UIBarButtonItem visibility priority/padding, UINavigationItem bar minimize, UIContextMenuConfiguration.allowsTypeSelect, UIDragInteraction lift behavior.
  • UITab/UITabGroup/UITabBarController/sidebar updates and UISearchTab static identifier.
  • UITextView NSTextViewportLayoutControllerDelegate conformance + viewport members, UIPhotoSearchSuggestion, UITextChecker grammar checking, plus the deprecation attributes for the supportedInterfaceOrientationsForWindow and UIScreen display-link APIs.

UIView CLBodyIdentifiable/CMBodyIdentifiable conformances are intentionally deferred: they require binding the new CoreLocation/CoreMotion marker protocols, tracked in those frameworks' own .todo files.

Resolve the UIKit entries in the iOS/tvOS/MacCatalyst .todo files for Xcode 27:

- NSTextBlock/NSTextTable/NSTextTableBlock + TextKit enums, and enable
  NSParagraphStyle/NSMutableParagraphStyle.textBlocks on UIKit platforms
  (remove the dummy NSTextBlock/NSTextTableBlock aliases in xkit.cs).
- Scene accessories (UISceneAccessory, UISceneAccessoryRegistration),
  UISceneClosureConfirmation, UISceneConfiguration init/initWithName:,
  UIWindowScene display-link/closure-confirmation, and the window-scene
  delegate supportedInterfaceOrientationsForWindowScene:.
- UIMenuElement/UIMenuLeaf image visibility + highlight handler.
- UIBarButtonItem visibility priority/padding, UINavigationItem bar
  minimize, UIContextMenuConfiguration.allowsTypeSelect, UIDragInteraction
  lift behavior.
- UITab/UITabGroup/UITabBarController/sidebar updates and UISearchTab
  static identifier.
- UITextView NSTextViewportLayoutControllerDelegate conformance + viewport
  members, UIPhotoSearchSuggestion, UITextChecker grammar checking, plus
  the deprecation attributes for the supportedInterfaceOrientationsForWindow
  and UIScreen display-link APIs.

UIView CLBodyIdentifiable/CMBodyIdentifiable conformances are intentionally
deferred: they require binding the new CoreLocation/CoreMotion marker
protocols, tracked in those frameworks' own .todo files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dalexsoto dalexsoto added this to the xcode27 milestone Jun 30, 2026
@dalexsoto
dalexsoto requested a review from rolfbjarne as a code owner June 30, 2026 18:31
Copilot AI review requested due to automatic review settings June 30, 2026 18:31
Comment thread src/UIKit/UIEnums.cs Outdated
}

// NSInteger -> NSTextTable.h
[TV (9, 0), iOS (6, 0), MacCatalyst (13, 1)]

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.

These availability attributes are redundant (except the MacCatalyst one maybe), but there should be a cecil test that catches this.

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

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@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.

- Drop the redundant [TV (9, 0), iOS (6, 0)] from the five NSTextBlock UIKit
  enums and keep only [MacCatalyst (13, 1)]: iOS 6 / tvOS 9 are below the
  minimum deployment targets, so those versions are stripped anyway.
- Mark NSTextBlock.backgroundColor and setBorderColor: as [NullAllowed] on
  every platform (both the AppKit and UIKit NSTextTable.h headers declare
  them nullable) and remove the now-obsolete macOS-AppKit.ignore
  !missing-null-allowed! suppressions for them.
- Replace the #if MONOMAC guards around the macOS-only members with
  [NoiOS, NoTV, NoMacCatalyst] (adding a `using NSRectEdge = System.Object`
  alias for the non-macOS build) and collapse the redundant protocol-list
  #if down to `NSSecureCoding, NSCopying`. The macOS generated code is
  unchanged (NSSecureCoding already implies NSCoding).
- Mark the UIBarMinimizeBehavior (Never/OnScrollDown/OnScrollUp) and
  UIBarMinimizationSafeAreaAdjustment (Enabled/Disabled) enum values as
  [NoTV] to match the native API_UNAVAILABLE(tvos) annotations. The enum
  types and the UINavigationItem properties that use them remain available
  on tvOS (only the non-Automatic values are tvOS-unavailable), which xtro
  was reporting as !extra-enum-value!.

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.

Comment thread src/xkit.cs Outdated

//Detected properties
[Export ("numberOfColumns")]
#if MONOMAC

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.

Not blocking, but maybe we can unite the platforms in the future?

Suggested change
#if MONOMAC
#if MONOMAC && !XAMCORE_5_0

Comment thread src/uikit.cs
[TV (27, 0), iOS (27, 0), MacCatalyst (27, 0)]
[Async]
[Export ("requestGrammarCheckingOfString:range:waitForAllResults:completionHandler:")]
void RequestGrammarChecking (string stringToCheck, NSRange range, bool waitForAllResults, [NullAllowed] UITextCheckerGrammarCompletionHandler completionHandler);

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.

Unrelated question: would there be any benefit to using this method in introspection's typo test?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@copilot create an issue so we do not forget

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.

Opened #25895.

…umns in XAMCORE_5_0

UITextView's conformance to NSTextViewportLayoutControllerDelegate is only
registered by the runtime starting with iOS 27.0 / tvOS 27.0 / Mac Catalyst
27.0 (the delegate methods are all API_AVAILABLE(ios(27.0), tvos(27.0))). The
introspection iOSApiProtocolTest.GeneralCase failed on iOS 16.0 and tvOS 16.0
because the previous skip only covered Mac Catalyst (which happened to be
tested on 26.4). Replace it with a version-gated skip that applies to all
platforms (return !TestRuntime.CheckXcodeVersion (27, 0)), matching the
existing ARObjectAnchor/ARTrackable "started with iOS 27.0" precedent. On OS
27.0+ the conformance is registered (verified on iOS/tvOS/Mac Catalyst 27), so
the check still runs there.

Also guard the macOS-only NSTextTable.Columns property name with
`#if MONOMAC && !XAMCORE_5_0` so the next major release unites the property
name across platforms as NumberOfColumns (per review feedback). This is a
no-op for the current build.

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 #aa4e075] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: aa4e0751b015019e6dcf8e81278264d730c2c426 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #aa4e075] Build passed (Build packages) ✅

Pipeline on Agent
Hash: aa4e0751b015019e6dcf8e81278264d730c2c426 [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: aa4e0751b015019e6dcf8e81278264d730c2c426 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #aa4e075] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: aa4e0751b015019e6dcf8e81278264d730c2c426 [PR build]

@dalexsoto
dalexsoto enabled auto-merge July 1, 2026 19:10
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #aa4e075] 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. [attempt 2] 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. 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: aa4e0751b015019e6dcf8e81278264d730c2c426 [PR build]

@dalexsoto
dalexsoto merged commit 2ecd755 into xcode27.0 Jul 1, 2026
55 checks passed
@dalexsoto
dalexsoto deleted the dev/alex/xc27UIKit branch July 1, 2026 21:07
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.

5 participants