Skip to content

[UIKit] Enable nullability and clean up UIAccessibility.#24568

Merged
rolfbjarne merged 2 commits intomainfrom
dev/rolf/uikit-nullability-uiaccessibility-01
Jan 29, 2026
Merged

[UIKit] Enable nullability and clean up UIAccessibility.#24568
rolfbjarne merged 2 commits intomainfrom
dev/rolf/uikit-nullability-uiaccessibility-01

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

This is file 1 of 30 files with nullability disabled in UIKit.

  • Enable nullability (#nullable enable).
  • Remove redundant [SupportedOSPlatform] attributes (groups of 4 without version numbers and no [UnsupportedOSPlatform] or [ObsoletedOSPlatform] attributes).
  • Use ArgumentNullException.ThrowIfNull() instead of manual null checks.
  • Add nullable annotations (NSObject?, UIView?).
  • Improve XML documentation comments: remove 'To be added.' placeholders, fix typos, add missing docs, add 'see cref' references, fix formatting.

Contributes towards #17285.

This is file 1 of 30 files with nullability disabled in UIKit.

* Enable nullability (#nullable enable).
* Remove redundant [SupportedOSPlatform] attributes (groups of 4 without version numbers and no [UnsupportedOSPlatform] or [ObsoletedOSPlatform] attributes).
* Use ArgumentNullException.ThrowIfNull() instead of manual null checks.
* Add nullable annotations (NSObject?, UIView?).
* Improve XML documentation comments: remove 'To be added.' placeholders, fix typos, add missing docs, add 'see cref' references, fix formatting.

Contributes towards #17285.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request enables nullable reference types and improves documentation for the UIAccessibility class in UIKit, which is the first of 30 files requiring nullability updates.

Changes:

  • Enabled nullable reference types (#nullable enable) for the UIAccessibility.cs file
  • Added nullable annotations to method parameters and return types (NSObject?, UIView?)
  • Replaced manual null checks with ArgumentNullException.ThrowIfNull() for better consistency
  • Removed redundant [SupportedOSPlatform] attributes from individual members (now inherited from class/enum level)
  • Added comprehensive XML documentation for properties and methods, removing "To be added" placeholders
  • Removed five properties from Documentation.KnownFailures.txt after adding proper documentation

Reviewed changes

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

File Description
tests/cecil-tests/Documentation.KnownFailures.txt Removed 5 UIAccessibility property documentation warnings that have now been resolved with proper XML comments
src/UIKit/UIAccessibility.cs Enabled nullability, added platform attributes to enums and class, added nullable annotations to parameters/returns, improved XML documentation, replaced manual null checks with ArgumentNullException.ThrowIfNull(), removed redundant platform attributes from class members, and removed partial keyword from class declaration

Comment thread src/UIKit/UIAccessibility.cs Outdated
Comment on lines 81 to 85
public static NSObject? FocusedElement (string assistiveTechnologyIdentifier)
{
using (var s = new NSString (assistiveTechnologyIdentifier))
return Runtime.GetNSObject (UIAccessibilityFocusedElement (s.Handle));
}
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

The assistiveTechnologyIdentifier parameter should have a null check. Since the method creates an NSString from it, passing null would cause an exception. Consider adding ArgumentNullException.ThrowIfNull (assistiveTechnologyIdentifier); at the beginning of the method.

Copilot uses AI. Check for mistakes.
Comment thread src/UIKit/UIAccessibility.cs
@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.

@rolfbjarne rolfbjarne enabled auto-merge (squash) January 28, 2026 09:20
@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #ab23bef] Build passed (Build packages) ✅

Pipeline on Agent
Hash: ab23bef4464e23d5177fc4df2a3dcb73282049ee [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

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

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

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #ab23bef] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: ab23bef4464e23d5177fc4df2a3dcb73282049ee [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

💻 [CI Build #ab23bef] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: ab23bef4464e23d5177fc4df2a3dcb73282049ee [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

💻 [CI Build #ab23bef] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: ab23bef4464e23d5177fc4df2a3dcb73282049ee [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

💻 [CI Build #ab23bef] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: ab23bef4464e23d5177fc4df2a3dcb73282049ee [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

💻 [CI Build #ab23bef] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: ab23bef4464e23d5177fc4df2a3dcb73282049ee [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

💻 [CI Build #ab23bef] Tests on macOS arm64 - Mac Tahoe (26) passed 💻

All tests on macOS arm64 - Mac Tahoe (26) passed.

Pipeline on Agent
Hash: ab23bef4464e23d5177fc4df2a3dcb73282049ee [PR build]

@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 #ab23bef] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 117 tests passed 🎉

Tests counts

✅ 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. [attempt 3] Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 9 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 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

Pipeline on Agent
Hash: ab23bef4464e23d5177fc4df2a3dcb73282049ee [PR build]

@rolfbjarne rolfbjarne merged commit 16e74e2 into main Jan 29, 2026
46 checks passed
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