Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UIKit] Update bindings to Xcode 13 Beta 5 #12706

Merged
merged 7 commits into from Sep 14, 2021

Conversation

dalexsoto
Copy link
Member

@dalexsoto dalexsoto commented Sep 11, 2021

No description provided.

@dalexsoto dalexsoto added the note-highlight Worth calling out specifically in release notes label Sep 11, 2021
@dalexsoto dalexsoto added this to the xcode13.0 milestone Sep 11, 2021
@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

4 tests failed, 98 tests passed.

Failed tests

  • link sdk/Mac Catalyst [dotnet]/Debug [dotnet]: TimedOut (Execution timed out after 1200 seconds.
    No test log file was produced)
  • link sdk/tvOS - simulator/Debug: Failed
  • link sdk/tvOS - simulator/Release: Failed
  • introspection/tvOS - simulator/Debug (tvOS 11.4): Failed

Pipeline on Agent XAMBOT-1104.BigSur'
Merge cd118fc into fc8b7c9

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

2 tests failed, 100 tests passed.

Failed tests

  • link sdk/tvOS - simulator/Debug: Failed
  • link sdk/tvOS - simulator/Release: Failed

Pipeline on Agent XAMBOT-1104.BigSur'
Merge d333bf6 into fc8b7c9

src/xkit.cs Outdated
@@ -1492,6 +1492,18 @@ interface NSDiffableDataSourceSnapshot<SectionIdentifierType, ItemIdentifierType
[Export ("sectionIdentifiers")]
SectionIdentifierType [] SectionIdentifiers { get; }

[TV (15,0), iOS (15,0), MacCatalyst (15,0)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This type is available for macOS as well, so it looks like it's missing the availability attribute for macOS.

src/xkit.cs Outdated
[TV (15,0), NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Static]
[Export ("registerTextAttachmentViewProviderClass:forFileType:")]
void RegisterTextAttachmentViewProviderClass (Class textAttachmentViewProviderClass, string fileType);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the swift name:

Suggested change
void RegisterTextAttachmentViewProviderClass (Class textAttachmentViewProviderClass, string fileType);
void RegisterViewProviderClass (Class textAttachmentViewProviderClass, string fileType);

@@ -31,3 +31,6 @@
!missing-selector! UISearchDisplayController::setSearchResultsTitle: not bound
!missing-selector! UIViewController::searchDisplayController not bound
!missing-type! UISearchDisplayController not bound

## Grouped nint constants
!unknown-native-enum! UIFocusGroupPriority bound
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing eol

src/uikit.cs Outdated
[iOS (15,0), TV (15,0), MacCatalyst (15,0)]
First = 1uL << 8,
[iOS (15,0), TV (15,0), MacCatalyst (15,0)]
Last = 1uL << 9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Last = 1uL << 9
Last = 1uL << 9,

src/uikit.cs Outdated
@@ -2047,6 +2120,7 @@ interface UIApplication {
[Transient]
UIWindow KeyWindow { get; }

[Deprecated (PlatformName.iOS, 15, 0, message: "Use 'UIWindowScene.Windows' the desired window scene instead.")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message here isn't grammatically correct, I'm not sure what it's supposed to be, but maybe something like this?

Suggested change
[Deprecated (PlatformName.iOS, 15, 0, message: "Use 'UIWindowScene.Windows' the desired window scene instead.")]
[Deprecated (PlatformName.iOS, 15, 0, message: "Use 'UIWindowScene.Windows' to get the desired window scene instead.")]

src/uikit.cs Outdated
@@ -3798,6 +3898,14 @@ interface UICollectionViewDelegate : UIScrollViewDelegate {
[return: NullAllowed]
NSIndexPath GetIndexPathForPreferredFocusedView (UICollectionView collectionView);

[NoWatch, NoTV, iOS (15,0), MacCatalyst (15,0)]
[Export ("collectionView:selectionFollowsFocusForItemAtIndexPath:")]
bool GetSelectionFollowsFocusForItemAtIndexPath (UICollectionView collectionView, NSIndexPath indexPath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bool GetSelectionFollowsFocusForItemAtIndexPath (UICollectionView collectionView, NSIndexPath indexPath);
bool GetSelectionFollowsFocusForItem (UICollectionView collectionView, NSIndexPath indexPath);

[Appearance]
[Export ("contentEdgeInsets")]
UIEdgeInsets ContentEdgeInsets {get;set;}

[Deprecated (PlatformName.iOS, 15, 0, message: "Ignored when 'UIButtonConfiguration' is used.")]
[Deprecated (PlatformName.TvOS, 15, 0, message: "Ignored when 'UIButtonConfiguration' is used.")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not deprecated on the watch?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This type is not available on Watch

#if !WATCH
	[BaseType (typeof (UIControl))]
	interface UIButton : UIAccessibilityContentSizeCategoryImageAdjusting
#if IOS

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then the [NoWatch] attribute on the other members added to this type is redundant.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some members, a few lines down, are decorated [Watch (8,0)]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And above there are a number of NoWatch too that are redundant. I think we could clean this up.

UILabel SubtitleLabel { get; }

[Deprecated (PlatformName.iOS, 15, 0, message: "Ignored when 'Configuration' is used, override 'LayoutSubviews', call base, and set position views on your own.")]
[Deprecated (PlatformName.TvOS, 15, 0, message: "Ignored when 'Configuration' is used, override 'LayoutSubviews', call base, and set position views on your own.")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same: not deprecated on the watch?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This type is not available on Watch

#if !WATCH
	[BaseType (typeof (UIControl))]
	interface UIButton : UIAccessibilityContentSizeCategoryImageAdjusting
#if IOS

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's am [Watch (8, 0)] on the previous member which should be removed then, at best it's confusing.

@dalexsoto
Copy link
Member Author

@rolfbjarne feedback applied, thank you!

[Appearance]
[Export ("contentEdgeInsets")]
UIEdgeInsets ContentEdgeInsets {get;set;}

[Deprecated (PlatformName.iOS, 15, 0, message: "Ignored when 'UIButtonConfiguration' is used.")]
[Deprecated (PlatformName.TvOS, 15, 0, message: "Ignored when 'UIButtonConfiguration' is used.")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then the [NoWatch] attribute on the other members added to this type is redundant.

UILabel SubtitleLabel { get; }

[Deprecated (PlatformName.iOS, 15, 0, message: "Ignored when 'Configuration' is used, override 'LayoutSubviews', call base, and set position views on your own.")]
[Deprecated (PlatformName.TvOS, 15, 0, message: "Ignored when 'Configuration' is used, override 'LayoutSubviews', call base, and set position views on your own.")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's am [Watch (8, 0)] on the previous member which should be removed then, at best it's confusing.

src/uikit.cs Outdated

[iOS (15,0), TV (15,0), Watch (8,0), MacCatalyst (15,0)]
[Export ("applicationShouldAutomaticallyLocalizeKeyCommands:")]
bool GetShouldAutomaticallyLocalizeKeyCommands (UIApplication application);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure the Get is needed here, Should is a verb

[Appearance]
[Export ("contentEdgeInsets")]
UIEdgeInsets ContentEdgeInsets {get;set;}

[Deprecated (PlatformName.iOS, 15, 0, message: "Ignored when 'UIButtonConfiguration' is used.")]
[Deprecated (PlatformName.TvOS, 15, 0, message: "Ignored when 'UIButtonConfiguration' is used.")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some members, a few lines down, are decorated [Watch (8,0)]

src/uikit.cs Outdated
[Appearance]
[TV (15,0), iOS (15,0), MacCatalyst (15,0)]
[NullAllowed, Export ("compactScrollEdgeAppearance", ArgumentSemantic.Copy)]
UINavigationBarAppearance compactScrollEdgeAppearance { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: compactScrollEdgeAppearance needs a capital C

src/uikit.cs Outdated

[TV (15,0), iOS (15,0), MacCatalyst (15,0)]
[NullAllowed, Export ("compactScrollEdgeAppearance", ArgumentSemantic.Copy)]
UINavigationBarAppearance compactScrollEdgeAppearance { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, needs capital C

src/uikit.cs Outdated
@@ -20822,6 +21414,11 @@ interface UIPointerRegion : NSCopying {
[DisableDefaultCtor]
interface UIPointerStyle : NSCopying {

// TODO: Enable with the UIPointerAccessory bindings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? forgotten or does it need a tracking issue ?

src/uikit.cs Show resolved Hide resolved
@dalexsoto
Copy link
Member Author

@spouliot Applied feedback! Also added UIPointerAccessory bindings

Assert.DoesNotThrow (() => acc = UIPointerAccessory.CreateArrow (UIPointerAccessoryPosition.Top), "Should not throw");
Assert.NotNull (acc, $"{nameof (acc)} was null");
Assert.AreEqual (acc.Position.Offset, UIPointerAccessoryPosition.Top.Offset, "Offset");
Assert.AreEqual (acc.Position.Angle, UIPointerAccessoryPosition.Top.Angle, "Offset");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: "Angle"

Assert.DoesNotThrow (() => acc = UIPointerAccessory.CreateArrow (UIPointerAccessoryPosition.TopRight), "Should not throw");
Assert.NotNull (acc, $"{nameof (acc)} was null");
Assert.AreEqual (acc.Position.Offset, UIPointerAccessoryPosition.TopRight.Offset, "Offset");
Assert.AreEqual (acc.Position.Angle, UIPointerAccessoryPosition.TopRight.Angle, "Offset");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: "Angle"

Assert.DoesNotThrow (() => acc = UIPointerAccessory.CreateArrow (UIPointerAccessoryPosition.Right), "Should not throw");
Assert.NotNull (acc, $"{nameof (acc)} was null");
Assert.AreEqual (acc.Position.Offset, UIPointerAccessoryPosition.Right.Offset, "Offset");
Assert.AreEqual (acc.Position.Angle, UIPointerAccessoryPosition.Right.Angle, "Offset");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: "Angle"

Assert.DoesNotThrow (() => acc = UIPointerAccessory.CreateArrow (UIPointerAccessoryPosition.BottomRight), "Should not throw");
Assert.NotNull (acc, $"{nameof (acc)} was null");
Assert.AreEqual (acc.Position.Offset, UIPointerAccessoryPosition.BottomRight.Offset, "Offset");
Assert.AreEqual (acc.Position.Angle, UIPointerAccessoryPosition.BottomRight.Angle, "Offset");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: "Angle"

Assert.DoesNotThrow (() => acc = UIPointerAccessory.CreateArrow (UIPointerAccessoryPosition.Bottom), "Should not throw");
Assert.NotNull (acc, $"{nameof (acc)} was null");
Assert.AreEqual (acc.Position.Offset, UIPointerAccessoryPosition.Bottom.Offset, "Offset");
Assert.AreEqual (acc.Position.Angle, UIPointerAccessoryPosition.Bottom.Angle, "Offset");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: "Angle"

Assert.DoesNotThrow (() => acc = UIPointerAccessory.CreateArrow (UIPointerAccessoryPosition.BottomLeft), "Should not throw");
Assert.NotNull (acc, $"{nameof (acc)} was null");
Assert.AreEqual (acc.Position.Offset, UIPointerAccessoryPosition.BottomLeft.Offset, "Offset");
Assert.AreEqual (acc.Position.Angle, UIPointerAccessoryPosition.BottomLeft.Angle, "Offset");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: "Angle"

Assert.DoesNotThrow (() => acc = UIPointerAccessory.CreateArrow (UIPointerAccessoryPosition.Left), "Should not throw");
Assert.NotNull (acc, $"{nameof (acc)} was null");
Assert.AreEqual (acc.Position.Offset, UIPointerAccessoryPosition.Left.Offset, "Offset");
Assert.AreEqual (acc.Position.Angle, UIPointerAccessoryPosition.Left.Angle, "Offset");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: "Angle"

Assert.DoesNotThrow (() => acc = UIPointerAccessory.CreateArrow (UIPointerAccessoryPosition.TopLeft), "Should not throw");
Assert.NotNull (acc, $"{nameof (acc)} was null");
Assert.AreEqual (acc.Position.Offset, UIPointerAccessoryPosition.TopLeft.Offset, "Offset");
Assert.AreEqual (acc.Position.Angle, UIPointerAccessoryPosition.TopLeft.Angle, "Offset");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: "Angle"

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

5 tests failed, 97 tests passed.

Failed tests

  • introspection/Mac Catalyst [dotnet]/Debug [dotnet]: TimedOut (Execution timed out after 1200 seconds.
    No test log file was produced)
  • introspection/iOS Unified 64-bits - simulator/Debug: Failed
  • introspection/iOS Unified 64-bits - simulator/Debug (iOS 11.4): Failed
  • link sdk/tvOS - simulator/Debug: Failed
  • link sdk/tvOS - simulator/Release: Failed

Pipeline on Agent XAMBOT-1100.BigSur'
Merge 3e3760a into 71d2edb

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

5 tests failed, 97 tests passed.

Failed tests

  • introspection/Mac Catalyst [dotnet]/Debug [dotnet]: Failed (Tests run: 44 Passed: 40 Inconclusive: 0 Failed: 1 Ignored: 3)
  • introspection/iOS Unified 64-bits - simulator/Debug: Failed
  • link sdk/Mac Catalyst [dotnet]/Debug [dotnet]: TimedOut (Execution timed out after 1200 seconds.
    No test log file was produced)
  • link sdk/tvOS - simulator/Debug: Failed
  • link sdk/tvOS - simulator/Release: Failed

Pipeline on Agent XAMBOT-1096.BigSur'
Merge 229389e into 3a1820c

Copy link
Member

@mandel-macaque mandel-macaque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs some cleanup and tests.

@@ -150,7 +150,46 @@ public override int GetHashCode ()
public static UIFloatRange Infinite = new UIFloatRange (nfloat.NegativeInfinity, nfloat.PositiveInfinity);
}
#endif


#if IOS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Availability is missing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmm Availability is there too!

#if !NET
 	[Introduced (PlatformName.iOS, 15,0)]
 #else
 	[SupportedOSPlatform ("ios15.0")]
 #endif //!NET

Angle = angle;
}

#if !COREBUILD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are missing for these manual code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/uikit.cs Outdated
@@ -7986,35 +8211,81 @@ interface UIButton : UIAccessibilityContentSizeCategoryImageAdjusting
[Export ("buttonWithType:primaryAction:")]
UIButton FromType (UIButtonType buttonType, [NullAllowed] UIAction primaryAction);

[TV (15,0), NoWatch, iOS (15,0), MacCatalyst (15,0)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NoWatch seems redundant since it is inside a #if !WATCH

[Appearance]
[Export ("contentEdgeInsets")]
UIEdgeInsets ContentEdgeInsets {get;set;}

[Deprecated (PlatformName.iOS, 15, 0, message: "Ignored when 'UIButtonConfiguration' is used.")]
[Deprecated (PlatformName.TvOS, 15, 0, message: "Ignored when 'UIButtonConfiguration' is used.")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And above there are a number of NoWatch too that are redundant. I think we could clean this up.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

3 tests failed, 99 tests passed.

Failed tests

  • introspection/Mac Catalyst [dotnet]/Debug [dotnet]: TimedOut (Execution timed out after 1200 seconds.
    No test log file was produced)
  • link sdk/tvOS - simulator/Debug: Failed
  • link sdk/tvOS - simulator/Release: Failed

Pipeline on Agent XAMBOT-1094.BigSur'
Merge 5097b9b into c2b7df3

@dalexsoto
Copy link
Member Author

@dalexsoto dalexsoto merged commit 8bc4fc6 into xamarin:main Sep 14, 2021
@dalexsoto dalexsoto deleted the xcode13-uikit branch September 14, 2021 20:31
@dalexsoto dalexsoto added this to September 2021 in Xcode 13 Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
note-highlight Worth calling out specifically in release notes
Projects
No open projects
Xcode 13
September 2021
Development

Successfully merging this pull request may close these issues.

None yet

5 participants