Skip to content

[UIKit] Enable nullability and clean up UIFontDescriptor.#24642

Merged
rolfbjarne merged 1 commit intomainfrom
dev/rolf/uikit-nullability-uifontdescriptor-10
Feb 6, 2026
Merged

[UIKit] Enable nullability and clean up UIFontDescriptor.#24642
rolfbjarne merged 1 commit intomainfrom
dev/rolf/uikit-nullability-uifontdescriptor-10

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

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

  • Enable nullability (#nullable enable).
  • Remove redundant [SupportedOSPlatform] attributes (groups of 3 without version numbers and no [UnsupportedOSPlatform] or [ObsoletedOSPlatform] attributes).
  • Add nullable annotations (string?, NSString?, NSCharacterSet?, UIFontTraits?, NSDictionary[]?, UIFontDescriptor[]?).
  • Inline XML documentation from external files (UIFontAttributes.xml, UIFontDescriptor.xml) and remove inlined entries.
  • Delete docs/api/UIKit/UIFontAttributes.xml (all content inlined).
  • Improve XML documentation comments: remove 'To be added.' placeholders, fix formatting, add missing docs, add 'see cref' references, remove empty and elements, remove duplicate elements, fix element ordering.
  • Add more unit tests.

Contributes towards #17285.

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

* Enable nullability (#nullable enable).
* Remove redundant [SupportedOSPlatform] attributes (groups of 3 without version numbers and no [UnsupportedOSPlatform] or [ObsoletedOSPlatform] attributes).
* Add nullable annotations (string?, NSString?, NSCharacterSet?, UIFontTraits?, NSDictionary[]?, UIFontDescriptor[]?).
* Inline XML documentation from external files (UIFontAttributes.xml, UIFontDescriptor.xml) and remove inlined entries.
* Delete docs/api/UIKit/UIFontAttributes.xml (all content inlined).
* Improve XML documentation comments: remove 'To be added.' placeholders, fix formatting, add missing docs, add 'see cref' references, remove empty <value> and <remarks> elements, remove duplicate <remarks> elements, fix element ordering.
* Add more unit tests.

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 in UIFontDescriptor.cs (file 10 of 30) as part of the effort to add nullability to UIKit. The changes improve type safety by properly annotating nullable properties, clean up documentation by inlining XML comments, and add comprehensive unit tests to verify the nullability behavior.

Changes:

  • Enabled #nullable enable in UIFontDescriptor.cs and added nullable annotations to properties (string?, NSString?, NSCharacterSet?, UIFontTraits?, NSDictionary[]?, UIFontDescriptor[]?)
  • Removed redundant [SupportedOSPlatform] attributes from PreferredTitle1, PreferredTitle2, PreferredTitle3, and PreferredCallout properties
  • Inlined XML documentation from external files and improved documentation quality (removed 'To be added' placeholders, added proper value descriptions, improved formatting)
  • Added comprehensive unit tests in FontDescriptorTest.cs to verify nullable property behavior
  • Deleted docs/api/UIKit/UIFontAttributes.xml after inlining its content

Reviewed changes

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

File Description
src/UIKit/UIFontDescriptor.cs Enabled nullability, added nullable annotations to properties, improved null handling in setters, inlined and cleaned up XML documentation, removed redundant platform attributes
tests/monotouch-test/UIKit/FontDescriptorTest.cs Added comprehensive unit tests for UIFontAttributes, UIFontDescriptor, and UIFontTraits to verify nullable property behavior and null clearing
docs/api/UIKit/UIFontDescriptor.xml Removed inlined FeatureSettings documentation (content moved to source file)
docs/api/UIKit/UIFontAttributes.xml Deleted entire file after inlining FeatureSettings documentation into source file

Comment thread src/UIKit/UIFontDescriptor.cs
@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #7f5edf3] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 7f5edf3995b98c623f631f53d1994ff09ce6ce73 [PR build]

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

✅ [CI Build #7f5edf3] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 7f5edf3995b98c623f631f53d1994ff09ce6ce73 [PR build]

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

✅ [CI Build #7f5edf3] Build passed (Build macOS tests) ✅

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

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

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

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

Pipeline on Agent
Hash: 7f5edf3995b98c623f631f53d1994ff09ce6ce73 [PR build]

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

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

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

Pipeline on Agent
Hash: 7f5edf3995b98c623f631f53d1994ff09ce6ce73 [PR build]

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

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

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

Pipeline on Agent
Hash: 7f5edf3995b98c623f631f53d1994ff09ce6ce73 [PR build]

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

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

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

Pipeline on Agent
Hash: 7f5edf3995b98c623f631f53d1994ff09ce6ce73 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne enabled auto-merge (squash) February 6, 2026 11:29
@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

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

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

Pipeline on Agent
Hash: 7f5edf3995b98c623f631f53d1994ff09ce6ce73 [PR build]

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

🚀 [CI Build #7f5edf3] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 130 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. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 12 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 11 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: 7f5edf3995b98c623f631f53d1994ff09ce6ce73 [PR build]

@rolfbjarne rolfbjarne merged commit 0e95b5e into main Feb 6, 2026
52 of 53 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.

5 participants