diff --git a/src/UIKit/UIAppearance.cs b/src/UIKit/UIAppearance.cs
index ff65932d9651..84a341a8b70c 100644
--- a/src/UIKit/UIAppearance.cs
+++ b/src/UIKit/UIAppearance.cs
@@ -7,10 +7,7 @@
// Copyright 2011, 2015 Xamarin Inc
//
-using System.Reflection;
-
-// Disable until we get around to enable + fix any issues.
-#nullable disable
+#nullable enable
namespace UIKit {
#if __TVOS__
@@ -21,27 +18,29 @@ namespace UIKit {
///
#endif
public partial class UIAppearance {
- /// To be added.
- /// Whether this is equivalent to .
- /// To be added.
- /// To be added.
- public override bool Equals (object other)
+ /// Determines whether the specified object is equal to the current .
+ /// The object to compare with the current instance.
+ /// if is a and has the same ; otherwise, .
+ public override bool Equals (object? other)
{
- UIAppearance ao = other as UIAppearance;
+ var ao = other as UIAppearance;
if (ao is null)
return false;
return ao.Handle == Handle;
}
/// Generates a hash code for the current instance.
- /// A int containing the hash code for this instance.
- /// The algorithm used to generate the hash code is unspecified.
+ /// A hash code for the current instance.
public override int GetHashCode ()
{
return Handle.GetHashCode ();
}
- public static bool operator == (UIAppearance a, UIAppearance b)
+ /// Determines whether two instances have the same native handle.
+ /// The first instance to compare.
+ /// The second instance to compare.
+ /// if both instances are or have the same ; otherwise, .
+ public static bool operator == (UIAppearance? a, UIAppearance? b)
{
if (ReferenceEquals (a, null))
return ReferenceEquals (b, null);
@@ -50,7 +49,11 @@ public override int GetHashCode ()
return a.Handle == b.Handle;
}
- public static bool operator != (UIAppearance a, UIAppearance b)
+ /// Determines whether two instances have different native handles.
+ /// The first instance to compare.
+ /// The second instance to compare.
+ /// if the instances have different native handles or exactly one is ; otherwise, .
+ public static bool operator != (UIAppearance? a, UIAppearance? b)
{
return !(a == b);
}
@@ -74,10 +77,12 @@ static IntPtr [] TypesToPointers (Type [] whenFoundIn)
}
#if TVOS
- // new in iOS9 but the only option for tvOS
const string selAppearanceWhenContainedInInstancesOfClasses = "appearanceWhenContainedInInstancesOfClasses:";
- // +(instancetype _Nonnull)appearanceWhenContainedInInstancesOfClasses:(NSArray> * _Nonnull)containerTypes
+ /// Gets the appearance proxy for a class in the specified containment hierarchy.
+ /// The Objective-C class pointer for the type to get the appearance proxy for.
+ /// The types representing the containment hierarchy in which the appearance should be applied.
+ /// The appearance proxy for the specified class when found in the specified containment hierarchy.
public static IntPtr GetAppearance (IntPtr class_ptr, params Type [] whenFoundIn)
{
using (var array = NSArray.FromIntPtrs (TypesToPointers (whenFoundIn))) {
@@ -88,11 +93,14 @@ public static IntPtr GetAppearance (IntPtr class_ptr, params Type [] whenFoundIn
const string selAppearanceForTraitCollectionWhenContainedInInstancesOfClasses = "appearanceForTraitCollection:whenContainedInInstancesOfClasses:";
- // new in iOS9 but the only option for tvOS
+ /// Gets the appearance proxy for a class with the specified trait collection in the specified containment hierarchy.
+ /// The Objective-C class pointer for the type to get the appearance proxy for.
+ /// The for which to return the appearance proxy.
+ /// The types representing the containment hierarchy in which the appearance should be applied.
+ /// The appearance proxy for the specified class and traits when found in the specified containment hierarchy.
public static IntPtr GetAppearance (IntPtr class_ptr, UITraitCollection traits, params Type [] whenFoundIn)
{
- if (traits is null)
- throw new ArgumentNullException ("traits");
+ ArgumentNullException.ThrowIfNull (traits);
using (var array = NSArray.FromIntPtrs (TypesToPointers (whenFoundIn))) {
IntPtr result = Messaging.IntPtr_objc_msgSend_IntPtr_IntPtr (class_ptr,
@@ -106,11 +114,10 @@ public static IntPtr GetAppearance (IntPtr class_ptr, UITraitCollection traits,
const string selAppearanceWhenContainedIn = "appearanceWhenContainedIn:";
const string selAppearanceForTraitCollectionWhenContainedIn = "appearanceForTraitCollection:whenContainedIn:";
- /// To be added.
- /// To be added.
- /// This object's appearance proxy in the specified containment hierarchy.
- /// To be added.
- /// To be added.
+ /// Gets the appearance proxy for a class in the specified containment hierarchy.
+ /// The Objective-C class pointer for the type to get the appearance proxy for.
+ /// The types representing the containment hierarchy in which the appearance should be applied.
+ /// The appearance proxy for the specified class when found in the specified containment hierarchy.
[BindingImpl (BindingImplOptions.Optimizable)]
public static IntPtr GetAppearance (IntPtr class_ptr, params Type [] whenFoundIn)
{
@@ -127,17 +134,15 @@ public static IntPtr GetAppearance (IntPtr class_ptr, params Type [] whenFoundIn
ptrs);
}
- /// To be added.
- /// To be added.
- /// To be added.
- /// Returns an appearance proxy for the specified when found in the containment hierarchy.
- /// To be added.
- /// To be added.
+ /// Gets the appearance proxy for a class with the specified trait collection in the specified containment hierarchy.
+ /// The Objective-C class pointer for the type to get the appearance proxy for.
+ /// The for which to return the appearance proxy.
+ /// The types representing the containment hierarchy in which the appearance should be applied.
+ /// The appearance proxy for the specified class and traits when found in the specified containment hierarchy.
[BindingImpl (BindingImplOptions.Optimizable)]
public static IntPtr GetAppearance (IntPtr class_ptr, UITraitCollection traits, params Type [] whenFoundIn)
{
- if (traits is null)
- throw new ArgumentNullException ("traits");
+ ArgumentNullException.ThrowIfNull (traits);
var ptrs = TypesToPointers (whenFoundIn);
@@ -154,22 +159,17 @@ public static IntPtr GetAppearance (IntPtr class_ptr, UITraitCollection traits,
GC.KeepAlive (traits);
return result;
}
-
- [DllImport (Messaging.LIBOBJC_DYLIB, EntryPoint = "objc_msgSend")]
- extern static IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr (IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, System.IntPtr arg5, System.IntPtr arg6, System.IntPtr arg7, System.IntPtr arg8, System.IntPtr arg9, System.IntPtr arg10, System.IntPtr arg11);
#endif
const string selAppearanceForTraitCollection = "appearanceForTraitCollection:";
- /// To be added.
- /// To be added.
- /// Returns an appearance proxy for the specified .
- /// To be added.
- /// To be added.
+ /// Gets the appearance proxy for a class with the specified trait collection.
+ /// The Objective-C class pointer for the type to get the appearance proxy for.
+ /// The for which to return the appearance proxy.
+ /// The appearance proxy for the specified class and traits.
public static IntPtr GetAppearance (IntPtr class_ptr, UITraitCollection traits)
{
- if (traits is null)
- throw new ArgumentNullException ("traits");
+ ArgumentNullException.ThrowIfNull (traits);
IntPtr result = Messaging.IntPtr_objc_msgSend_IntPtr (class_ptr, Selector.GetHandle (UIAppearance.selAppearanceForTraitCollection), traits.Handle);
GC.KeepAlive (traits);
diff --git a/tests/cecil-tests/Documentation.KnownFailures.txt b/tests/cecil-tests/Documentation.KnownFailures.txt
index 1f11d69c2001..43cc18754783 100644
--- a/tests/cecil-tests/Documentation.KnownFailures.txt
+++ b/tests/cecil-tests/Documentation.KnownFailures.txt
@@ -16947,8 +16947,6 @@ M:UIKit.UIAlertView.remove_Presented(System.EventHandler)
M:UIKit.UIAlertView.remove_WillDismiss(System.EventHandler{UIKit.UIButtonEventArgs})
M:UIKit.UIAlertView.remove_WillPresent(System.EventHandler)
M:UIKit.UIAlertView.UIAlertViewAppearance.#ctor(System.IntPtr)
-M:UIKit.UIAppearance.op_Equality(UIKit.UIAppearance,UIKit.UIAppearance)
-M:UIKit.UIAppearance.op_Inequality(UIKit.UIAppearance,UIKit.UIAppearance)
M:UIKit.UIApplication_DefaultApplication.GetDefaultStatus(UIKit.UIApplication,UIKit.UIApplicationCategory,Foundation.NSError@)
M:UIKit.UIApplication.AccessibilityActivate
M:UIKit.UIApplication.Dispose(System.Boolean)
diff --git a/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-size.txt b/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-size.txt
index 6d966d8a337b..b31e62171bd7 100644
--- a/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-size.txt
+++ b/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-size.txt
@@ -1,14 +1,14 @@
-AppBundleSize: 3,611,965 bytes (3,527.3 KB = 3.4 MB)
+AppBundleSize: 3,611,466 bytes (3,526.8 KB = 3.4 MB)
# The following list of files and their sizes is just informational / for review, and isn't used in the test:
_CodeSignature/CodeResources: 3,997 bytes (3.9 KB = 0.0 MB)
archived-expanded-entitlements.xcent: 384 bytes (0.4 KB = 0.0 MB)
-Info.plist: 1,163 bytes (1.1 KB = 0.0 MB)
-Microsoft.iOS.dll: 151,040 bytes (147.5 KB = 0.1 MB)
+Info.plist: 1,160 bytes (1.1 KB = 0.0 MB)
+Microsoft.iOS.dll: 150,528 bytes (147.0 KB = 0.1 MB)
PkgInfo: 8 bytes (0.0 KB = 0.0 MB)
runtimeconfig.bin: 1,405 bytes (1.4 KB = 0.0 MB)
SizeTestApp: 2,404,544 bytes (2,348.2 KB = 2.3 MB)
SizeTestApp.dll: 7,680 bytes (7.5 KB = 0.0 MB)
-System.Private.CoreLib.aotdata.arm64: 41,296 bytes (40.3 KB = 0.0 MB)
+System.Private.CoreLib.aotdata.arm64: 41,312 bytes (40.3 KB = 0.0 MB)
System.Private.CoreLib.dll: 987,136 bytes (964.0 KB = 0.9 MB)
System.Runtime.dll: 5,120 bytes (5.0 KB = 0.0 MB)
System.Runtime.InteropServices.dll: 8,192 bytes (8.0 KB = 0.0 MB)
diff --git a/tests/dotnet/UnitTests/expected/iOS-MonoVM-size.txt b/tests/dotnet/UnitTests/expected/iOS-MonoVM-size.txt
index e9b92899cb31..dc3acfb5ca4e 100644
--- a/tests/dotnet/UnitTests/expected/iOS-MonoVM-size.txt
+++ b/tests/dotnet/UnitTests/expected/iOS-MonoVM-size.txt
@@ -1,9 +1,9 @@
-AppBundleSize: 9,362,185 bytes (9,142.8 KB = 8.9 MB)
+AppBundleSize: 9,362,182 bytes (9,142.8 KB = 8.9 MB)
# The following list of files and their sizes is just informational / for review, and isn't used in the test:
_CodeSignature/CodeResources: 5,229 bytes (5.1 KB = 0.0 MB)
aot-instances.aotdata.arm64: 827,592 bytes (808.2 KB = 0.8 MB)
archived-expanded-entitlements.xcent: 384 bytes (0.4 KB = 0.0 MB)
-Info.plist: 1,163 bytes (1.1 KB = 0.0 MB)
+Info.plist: 1,160 bytes (1.1 KB = 0.0 MB)
Microsoft.iOS.aotdata.arm64: 22,872 bytes (22.3 KB = 0.0 MB)
Microsoft.iOS.dll: 48,640 bytes (47.5 KB = 0.0 MB)
PkgInfo: 8 bytes (0.0 KB = 0.0 MB)
diff --git a/tests/dotnet/UnitTests/expected/iOS-NativeAOT-size.txt b/tests/dotnet/UnitTests/expected/iOS-NativeAOT-size.txt
index 3735c88837b0..aa194e22ad61 100644
--- a/tests/dotnet/UnitTests/expected/iOS-NativeAOT-size.txt
+++ b/tests/dotnet/UnitTests/expected/iOS-NativeAOT-size.txt
@@ -1,8 +1,8 @@
-AppBundleSize: 2,450,656 bytes (2,393.2 KB = 2.3 MB)
+AppBundleSize: 2,450,653 bytes (2,393.2 KB = 2.3 MB)
# The following list of files and their sizes is just informational / for review, and isn't used in the test:
_CodeSignature/CodeResources: 2,589 bytes (2.5 KB = 0.0 MB)
archived-expanded-entitlements.xcent: 384 bytes (0.4 KB = 0.0 MB)
-Info.plist: 1,163 bytes (1.1 KB = 0.0 MB)
+Info.plist: 1,160 bytes (1.1 KB = 0.0 MB)
PkgInfo: 8 bytes (0.0 KB = 0.0 MB)
runtimeconfig.bin: 1,808 bytes (1.8 KB = 0.0 MB)
SizeTestApp: 2,444,704 bytes (2,387.4 KB = 2.3 MB)