From 703ee68cec73f0976e1ac70e754da6487b71d1a4 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 15 Sep 2023 11:58:21 +0200 Subject: [PATCH] [UIKit] Make UIView.HitTest's return value nullable. Fixes #19019. (#19025) Fixes https://github.com/xamarin/xamarin-macios/issues/19019. --- src/uikit.cs | 1 + tests/xtro-sharpie/api-annotations-dotnet/iOS-UIKit.ignore | 1 - tests/xtro-sharpie/api-annotations-dotnet/tvOS-UIKit.ignore | 1 - tests/xtro-sharpie/iOS-UIKit.ignore | 1 - tests/xtro-sharpie/tvOS-UIKit.ignore | 1 - 5 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/uikit.cs b/src/uikit.cs index c8d2b904e5b7..4595fab6d500 100644 --- a/src/uikit.cs +++ b/src/uikit.cs @@ -16425,6 +16425,7 @@ interface UIView : UIAppearance, UIAppearanceContainer, UIAccessibility, UIDynam bool ExclusiveTouch { [Bind ("isExclusiveTouch")] get; set; } [Export ("hitTest:withEvent:")] + [return: NullAllowed] UIView HitTest (CGPoint point, [NullAllowed] UIEvent uievent); [Export ("pointInside:withEvent:")] diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-UIKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/iOS-UIKit.ignore index d2f5b923b7a3..f6c391b08ab3 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-UIKit.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/iOS-UIKit.ignore @@ -337,7 +337,6 @@ !missing-null-allowed! 'UIKit.UIView UIKit.UITableViewDelegate::GetViewForHeader(UIKit.UITableView,System.IntPtr)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UITouch::get_View()' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UIView::get_Superview()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'UIKit.UIView UIKit.UIView::HitTest(CoreGraphics.CGPoint,UIKit.UIEvent)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UIView::SnapshotView(System.Boolean)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UIView::ViewWithTag(System.IntPtr)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UIViewControllerContextTransitioning::GetViewFor(Foundation.NSString)' is missing an [NullAllowed] on return type diff --git a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-UIKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-UIKit.ignore index 0ad109c201ad..9ea1c8e21d0f 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-UIKit.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-UIKit.ignore @@ -288,7 +288,6 @@ !missing-null-allowed! 'UIKit.UIView UIKit.UITableViewDelegate::GetViewForHeader(UIKit.UITableView,System.IntPtr)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UITouch::get_View()' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UIView::get_Superview()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'UIKit.UIView UIKit.UIView::HitTest(CoreGraphics.CGPoint,UIKit.UIEvent)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UIView::SnapshotView(System.Boolean)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UIView::ViewWithTag(System.IntPtr)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UIViewControllerContextTransitioning::GetViewFor(Foundation.NSString)' is missing an [NullAllowed] on return type diff --git a/tests/xtro-sharpie/iOS-UIKit.ignore b/tests/xtro-sharpie/iOS-UIKit.ignore index 1ec4de787aa2..da6a78c36985 100644 --- a/tests/xtro-sharpie/iOS-UIKit.ignore +++ b/tests/xtro-sharpie/iOS-UIKit.ignore @@ -361,7 +361,6 @@ !missing-null-allowed! 'UIKit.UIView UIKit.UITableViewDelegate::GetViewForHeader(UIKit.UITableView,System.nint)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UITouch::get_View()' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UIView::get_Superview()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'UIKit.UIView UIKit.UIView::HitTest(CoreGraphics.CGPoint,UIKit.UIEvent)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UIView::SnapshotView(System.Boolean)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UIView::ViewWithTag(System.nint)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UIViewControllerContextTransitioning::GetViewFor(Foundation.NSString)' is missing an [NullAllowed] on return type diff --git a/tests/xtro-sharpie/tvOS-UIKit.ignore b/tests/xtro-sharpie/tvOS-UIKit.ignore index 56984cb00836..2f8fbdf14a23 100644 --- a/tests/xtro-sharpie/tvOS-UIKit.ignore +++ b/tests/xtro-sharpie/tvOS-UIKit.ignore @@ -300,7 +300,6 @@ !missing-null-allowed! 'UIKit.UIView UIKit.UITableViewDelegate::GetViewForHeader(UIKit.UITableView,System.nint)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UITouch::get_View()' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UIView::get_Superview()' is missing an [NullAllowed] on return type -!missing-null-allowed! 'UIKit.UIView UIKit.UIView::HitTest(CoreGraphics.CGPoint,UIKit.UIEvent)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UIView::SnapshotView(System.Boolean)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UIView::ViewWithTag(System.nint)' is missing an [NullAllowed] on return type !missing-null-allowed! 'UIKit.UIView UIKit.UIViewControllerContextTransitioning::GetViewFor(Foundation.NSString)' is missing an [NullAllowed] on return type