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

UITraitCollection bindings #21377

Closed
tipa opened this issue Oct 5, 2024 · 3 comments · Fixed by #21380
Closed

UITraitCollection bindings #21377

tipa opened this issue Oct 5, 2024 · 3 comments · Fixed by #21380
Assignees
Milestone

Comments

@tipa
Copy link

tipa commented Oct 5, 2024

Apple platform

iOS

Framework version

net8.0-*

Affected platform version

.NET 8

Description

Issue 1:
The traitCollectionWithTraitsFromCollections: method is deprecated since iOS 17, but in the .NET bindings the method FromTraitsFromCollections is not marked as obsolete.

Issue 2:
I want to use the traitCollectionByModifyingTraits: method (which I think is the "replacement" for the deprecated method mentioned above) as demonstrated here: https://developer.apple.com/wwdc23/10057?time=146. The bindings do have GetTraitCollectionByModifyingTraits methods, but it does not provide an instance of IUIMutableTraits in the closure.

@rolfbjarne rolfbjarne added this to the Future milestone Oct 7, 2024
@rolfbjarne
Copy link
Member

I can confirm our bindings are wrong, fix is in progress.

@rolfbjarne rolfbjarne self-assigned this Oct 7, 2024
rolfbjarne added a commit that referenced this issue Oct 7, 2024
The methods 'GetTraitCollectionWithTraits' and
'GetTraitCollectionByModifyingTraits' takes a callback, but the callback had
the wrong signature.

So introduce a new overload for each of these methods, using a delegate with
the correct signature.

Also deprecate 'FromTraitsFromCollections' according to both headers and
documentation.

Fixes #21377.
@rolfbjarne
Copy link
Member

rolfbjarne commented Oct 7, 2024

PR in progress.

Do you need a workaround until this is released (which will probably be together with Xcode 16.1 support, whenever that happens)?

@tipa
Copy link
Author

tipa commented Oct 7, 2024

Thanks for the fix. I don't need a workaround, using the deprecated method seems to be working fine for now

haritha-mohan pushed a commit that referenced this issue Oct 19, 2024
The methods 'GetTraitCollectionWithTraits' and 'GetTraitCollectionByModifyingTraits' takes a callback, but the callback
had the wrong signature.

So introduce a new overload for each of these methods, using a delegate with the correct signature.

Also deprecate 'FromTraitsFromCollections' according to both headers and documentation.

Fixes #21377.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants