Skip to content

[MessageUI] Update bindings up to Xcode 27.0 Beta 3 - #26180

Merged
dalexsoto merged 2 commits into
xcode27.0from
dev/alex/xc27-MessageUI
Jul 22, 2026
Merged

[MessageUI] Update bindings up to Xcode 27.0 Beta 3#26180
dalexsoto merged 2 commits into
xcode27.0from
dev/alex/xc27-MessageUI

Conversation

@dalexsoto

@dalexsoto dalexsoto commented Jul 17, 2026

Copy link
Copy Markdown
Member

Summary

  • Bind MFMailDraft, including its properties and full initializer, for iOS and Mac Catalyst.
  • Bind MFComposeAssistantViewController and its required delegate protocol.
  • Keep native initialization paths that create invalid state or abort non-public, while exposing initWithDelegate: as the supported initializer.
  • Mirror Apple’s header by leaving initWithDelegate: without designated-initializer metadata, and narrowly exempt the inherited UIViewController initializer that aborts at runtime.
  • Remove the resolved MessageUI xtro todo files.

Validation

  • make world
  • Clean xtro generation/classification: sanity passed with no MessageUI unclassified entries
  • Clean Cecil suite: passed
  • Focused iOS 27 constructor introspection: designated-initializer check passed; only unrelated existing UIBarMinimization default-constructor failure remains
  • Focused Mac Catalyst constructor introspection: 3/3 passed
  • Mac Catalyst full introspection: 39/39 passed; macOS full introspection: 32/32 passed
  • Full iOS/tvOS introspection completed with no MessageUI failures; remaining failures are unrelated Xcode 27 beta runtime gaps in UIKit, AVKit, and AVFoundation
  • Clean AppSizeTest: 0 failures; all 16 cases skipped by the beta-Xcode guard

Bind MFMailDraft and MFComposeAssistantViewController for iOS and Mac Catalyst.

Model the draft properties, initializer, compose-assistant delegate, and required callback with Xcode 27 availability and nullability. Hide native initialization paths that produce invalid state or abort, and identify initWithDelegate: as the valid designated initializer.

Remove the resolved xtro todo files and document the SDK-header/runtime mismatch for the designated initializer.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 153b8939-99d0-4969-9178-e1f2fc5ce69a
Copilot AI review requested due to automatic review settings July 17, 2026 23:54
@dalexsoto dalexsoto added this to the xcode27 milestone Jul 17, 2026
@dalexsoto
dalexsoto requested a review from rolfbjarne July 17, 2026 23:54

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

Updates the MessageUI bindings to align with Xcode 27.0 Beta 3 by adding new types/APIs and adjusting test expectations in xtro annotations to reflect a designated-initializer mismatch between headers and runtime behavior.

Changes:

  • Added bindings for MFMailDraft, MFComposeAssistantViewController, and MFComposeAssistantViewControllerDelegate (iOS/Mac Catalyst 27.0).
  • Hid unsafe initialization paths for MFComposeAssistantViewController and exposed initWithDelegate: as the designated initializer.
  • Removed resolved MessageUI xtro .todo files and added .ignore entries documenting/acknowledging the header vs runtime designated-initializer discrepancy.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-MessageUI.todo Removed resolved xtro TODO entries after bindings were added.
tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-MessageUI.ignore Added ignore entry (and rationale) for the designated-initializer mismatch reported by xtro.
tests/xtro-sharpie/api-annotations-dotnet/iOS-MessageUI.todo Removed resolved xtro TODO entries after bindings were added.
tests/xtro-sharpie/api-annotations-dotnet/iOS-MessageUI.ignore Added ignore entry (and rationale) for the designated-initializer mismatch reported by xtro.
src/messageui.cs Introduced new MessageUI bindings for Xcode 27.0 APIs and adjusted initialization semantics.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@dalexsoto

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@dalexsoto

Copy link
Copy Markdown
Member Author

/azp run xamarin-macios-sim-pr-tests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

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

@dalexsoto
dalexsoto enabled auto-merge (squash) July 18, 2026 21:05
Comment thread tests/xtro-sharpie/api-annotations-dotnet/iOS-MessageUI.ignore Outdated
Remove the designated-initializer attribute from MFComposeAssistantViewController.initWithDelegate: because the Xcode header does not annotate it.

Drop the corresponding xtro exceptions and add a narrow introspection match for the inherited UIViewController initializer that aborts at runtime. Keep the invalid generated initialization paths non-public.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 153b8939-99d0-4969-9178-e1f2fc5ce69a
@dalexsoto
dalexsoto requested a review from rolfbjarne July 20, 2026 15:50
@vs-mobiletools-engineering-service2

This comment has been minimized.

@dalexsoto

Copy link
Copy Markdown
Member Author

/azp run xamarin-macios-sim-pr-tests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@dalexsoto

Copy link
Copy Markdown
Member Author

/azp run xamarin-macios-pr-apidiff

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@vs-mobiletools-engineering-service2

This comment has been minimized.

@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: 897e85a4b8e8e206c57ea59a7b0c3088abf18e15 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@dalexsoto

Copy link
Copy Markdown
Member Author

/azp run xamarin-macios-sim-pr-tests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@dalexsoto

Copy link
Copy Markdown
Member Author

/azp run xamarin-macios-sim-pr-tests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Comment thread src/messageui.cs
/// <summary>Provides an interface for composing an email draft.</summary>
[NoTV, NoMac, iOS (27, 0), MacCatalyst (27, 0)]
[BaseType (typeof (UIViewController))]
[PrivateDefaultCtor] // init and initWithCoder: abort at runtime

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.

Why not just [DisableDefaultCtor]?

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.

[DisableDefaultCtor] only suppresses the generated parameterless init. Because UIViewController conforms to NSCoding, bgen separately emits .ctor(NSCoder) and leaves it public under [DisableDefaultCtor]. On the Xcode 27 Beta 3 runtime, both initWithCoder: and initWithNibName:bundle: unconditionally trap; only initWithDelegate: works. [PrivateDefaultCtor] is intentional so the generated init and .ctor(NSCoder) stay non-public, while the narrow introspection match avoids re-exposing the trapping nib initializer. I verified this against the generated iOS/Mac Catalyst sources and the Beta 3 runtime implementation. There is no separate bgen attribute to suppress only the NSCoder constructor.

@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

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #897e85a] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 195 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 19 tests passed. [attempt 4] Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (macOS): All 19 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 19 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): Tests skipped, incorrect beta version. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 897e85a4b8e8e206c57ea59a7b0c3088abf18e15 [PR build]

@dalexsoto
dalexsoto merged commit cf6ff84 into xcode27.0 Jul 22, 2026
55 checks passed
@dalexsoto
dalexsoto deleted the dev/alex/xc27-MessageUI branch July 22, 2026 02:37
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