From b708d92398de0d740d72074201a1ed8ce179c831 Mon Sep 17 00:00:00 2001 From: Copilot Date: Wed, 28 Jan 2026 09:52:26 +0100 Subject: [PATCH] [UIKit] Enable nullability and clean up UIAccessibilityCustomAction. * Enable nullability (#nullable enable). * Use ArgumentNullException.ThrowIfNull() instead of manual null check. * Add nullable annotation (object?). * Improve XML documentation comments: remove 'To be added.' placeholders, fix typos, add missing docs, fix formatting. Contributes towards https://github.com/dotnet/macios/issues/17285. --- src/UIKit/UIAccessibilityCustomAction.cs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/UIKit/UIAccessibilityCustomAction.cs b/src/UIKit/UIAccessibilityCustomAction.cs index 1c3390273458..7c39e3c6a8b5 100644 --- a/src/UIKit/UIAccessibilityCustomAction.cs +++ b/src/UIKit/UIAccessibilityCustomAction.cs @@ -9,21 +9,21 @@ using CoreGraphics; -// Disable until we get around to enable + fix any issues. -#nullable disable +#nullable enable namespace UIKit { + /// + /// A custom action to be presented to an assistive application. + /// public partial class UIAccessibilityCustomAction { - object action; + object? action; - /// To be added. - /// To be added. - /// Creates a withthe specified . - /// To be added. + /// Creates a with the specified . + /// The name of the action. + /// A callback to invoke when the action is activated. public UIAccessibilityCustomAction (string name, Func probe) : this (name, FuncBoolDispatcher.Selector, new FuncBoolDispatcher (probe)) { - } internal UIAccessibilityCustomAction (string name, Selector sel, FuncBoolDispatcher disp) : this (name, disp, sel) @@ -42,8 +42,7 @@ internal sealed class FuncBoolDispatcher : NSObject { public FuncBoolDispatcher (Func probe) { - if (probe is null) - throw new ArgumentNullException ("probe"); + ArgumentNullException.ThrowIfNull (probe); this.probe = probe; IsDirectBinding = false;