You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The return type of IUIContentConfiguration.MakeContentView() is simply IUIContentView. By contrast, in Swift it is UIView & UIContentView (and similarly in Objective-C), so we're missing the idea that the return type is not just an object that conforms to UIContentView, but it's specifically a UIView. Attempting to cast the result of MakeContentView() to UIView fails, which is also incorrect. This makes the composability aspect of content configurations unusable in C#: you can't take one configuration's view and embed it inside another.
Steps to Reproduce
Attempt to cast the result of a MakeContentView() call to UIView.
The result is null, which is incorrect. The result is always a UIView.
Did you find any workaround?
I haven't tried it yet, but I could make a subclass of UIView that implements IUIContentView, and return that from my custom content configurations. I think that would get around the casting issue for those cases, but it would not help for when I want to embed a system content configuration inside a custom one.
Relevant log output
No response
The text was updated successfully, but these errors were encountered:
I'm not sure this is possible to bind correctly in C# without some ugly workarounds, because it's not possible to express in C# that a return type is both of a specific type and implements an interface.
Something like this might be an option, where you get two variables:
However, can you explain a bit more how you want to use the return value, that might give me more ideas on how to bind it? If possible with some actual code samples.
The goal is to use content configurations compositionally. For example, to take a standard cell content view such as from UIListContentConfiguration.ValueCellConfiguration and add an error/info message below it.
I tried out Runtime.GetNSObject and it does seem to work. Thanks!
Apple platform
iOS
Framework version
net8.0-*
Affected platform version
.NET 8.0.100 18.0.8303
Description
The return type of
IUIContentConfiguration.MakeContentView()
is simplyIUIContentView
. By contrast, in Swift it isUIView & UIContentView
(and similarly in Objective-C), so we're missing the idea that the return type is not just an object that conforms toUIContentView
, but it's specifically aUIView
. Attempting to cast the result ofMakeContentView()
toUIView
fails, which is also incorrect. This makes the composability aspect of content configurations unusable in C#: you can't take one configuration's view and embed it inside another.Steps to Reproduce
MakeContentView()
call toUIView
.UIView
.Did you find any workaround?
I haven't tried it yet, but I could make a subclass of
UIView
that implementsIUIContentView
, and return that from my custom content configurations. I think that would get around the casting issue for those cases, but it would not help for when I want to embed a system content configuration inside a custom one.Relevant log output
No response
The text was updated successfully, but these errors were encountered: