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

[maccatalyst] UICollectionViewSource is missing methods #11236

Closed
jeromelaban opened this issue Apr 19, 2021 · 4 comments
Closed

[maccatalyst] UICollectionViewSource is missing methods #11236

jeromelaban opened this issue Apr 19, 2021 · 4 comments
Labels
bug If an issue is a bug or a pull request a bug fix Mac Catalyst Issues affecting Mac Catalyst
Milestone

Comments

@jeromelaban
Copy link
Contributor

jeromelaban commented Apr 19, 2021

Description

The following methods are present in xamarinios10 and net6.0-ios but are not present in net6.0-maccatalyst:

  • UICollectionViewSource.Scolled
  • UICollectionViewSource.DraggingStarted
  • UICollectionViewSource.DraggingEnded
  • UICollectionViewSource.DidZoom
  • UICollectionViewSource.WillEndDragging
  • UICollectionViewSource.DecelerationEnded
  • UICollectionViewSource.ScrollAnimationEmded

Environment

6.0.100-preview.3.21202.5

@spouliot spouliot added the need-info Waiting for more information before the bug can be investigated label Apr 19, 2021
@spouliot spouliot added this to the Mac Catalyst milestone Apr 19, 2021
@spouliot
Copy link
Contributor

Keep in mind that MacCatalyst support, even for the current (soon legacy) SDK is a preview and incomplete. YMMV.

The API surface for iOS and Catalyst are not totally identical. We're trying to solve this by shipping a Xamarin.iOS.dll along with Xamarin.MacCatalyst.dll.

This special Xamarin.iOS.dll contains:

  • type forwarders to Xamarin.MacCatalyst.dll when an API is available on Catalyst;
  • empty stubs that will throw a PlatformNotSupportedException for other, non available, API

The above trick was not generating a perfect/total coverage for P3 (it was incomplete at P3 release time).
This should be accurate for P4 (or it will be a bug in our tooling).

Note that we're still missing some API annotations for Catalyst so it's still possible something will throw (while it should be supported) or crash (because it should be throwing). However it should build fine when Xamarin.iOS.dll is used.

Now if you're referencing Xamarin.MacCatalyst.dll directly then some missing (or incorrect) annotations might be excluding some API. We have tools to report those errors - but there's quite a backlog to process until completion. If you're blocked by something then feel free to open bugs and we'll prioritize those API (over others) for the next release(s).

Q: What assembly are you referencing ? (any build logs?)

@jeromelaban
Copy link
Contributor Author

jeromelaban commented Apr 19, 2021

Thanks for the very detailed answer! No worries about the preview state, that's to be expected for sure.

I'm not referencing anything specific, aside from net6.0-maccatalyst, and looking at the IL disassembly of UICollectionViewSource in Xamarin.MacCatalyst.dll I see that those members are also effectively missing.

The source is basically doing something like this:

public partial class MySource : UICollectionViewSource
{
	public override void Scrolled(UIScrollView scrollView)
	{
		InvokeOnScroll();
	}
}

@spouliot
Copy link
Contributor

This seems to be because XAMCORE_3_0 is defined, like tvOS and watchOS. This does remove a few mistakes (on both our and Apple sides) but reduce compatibility in those corner cases.

src/Makefile:MACCATALYST_GENERATED_DEFINES= -d:__MACCATALYST__ -d:XAMCORE_3_0 -d:IOS

@spouliot spouliot added bug If an issue is a bug or a pull request a bug fix Mac Catalyst Issues affecting Mac Catalyst and removed need-info Waiting for more information before the bug can be investigated labels Apr 19, 2021
spouliot pushed a commit to spouliot/xamarin-macios that referenced this issue Apr 19, 2021
`XAMCORE_3_0` was added in tvOS and watchOS where binary compatibility
was not a consideration. The work to update source code for `XAMCORE_3_0`
was also minimal.

The former is not the always the case for MacCatalyst, while the latter
is still true.

Fix dotnet#11237 and dotnet#11236
spouliot added a commit that referenced this issue Apr 20, 2021
…11238)

`XAMCORE_3_0` was added in tvOS and watchOS where binary compatibility
was not a consideration. The work to update source code for `XAMCORE_3_0`
was also minimal.

The former is not the always the case for MacCatalyst, while the latter
is still true.

Fix #11237 and #11236
@spouliot
Copy link
Contributor

You can see the API in the (just merged) API diff
https://gist.github.com/vs-mobiletools-engineering-service2/3329d5705cffab4bb74f418414111b77

@ghost ghost locked as resolved and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug If an issue is a bug or a pull request a bug fix Mac Catalyst Issues affecting Mac Catalyst
Projects
None yet
Development

No branches or pull requests

2 participants