[UIKit] Enable nullability and clean up UIFontDescriptor.#24642
[UIKit] Enable nullability and clean up UIFontDescriptor.#24642rolfbjarne merged 1 commit intomainfrom
Conversation
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.
There was a problem hiding this comment.
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 enableinUIFontDescriptor.csand 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.csto verify nullable property behavior - Deleted
docs/api/UIKit/UIFontAttributes.xmlafter 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 |
✅ [CI Build #7f5edf3] Build passed (Build packages) ✅Pipeline on Agent |
✅ [CI Build #7f5edf3] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ [CI Build #7f5edf3] Build passed (Build macOS tests) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
💻 [CI Build #7f5edf3] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #7f5edf3] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #7f5edf3] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [CI Build #7f5edf3] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
💻 [CI Build #7f5edf3] Tests on macOS arm64 - Mac Tahoe (26) passed 💻✅ All tests on macOS arm64 - Mac Tahoe (26) passed. Pipeline on Agent |
🚀 [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 Pipeline on Agent |
This is file 10 of 30 files with nullability disabled in UIKit.
Contributes towards #17285.