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
Ability to define a UIViewController type #3478
Comments
Thanks for the report. We are currently iterating on API design and real usage examples like this are quite useful. |
Hello @elijah-semyonov, you can find here a working sample 😉 |
@GuilhE |
I believe that's the work around I'm using, basically I've a Singleton with a |
We are drifting toward a design, where the state is managed outside of ComposeWindow for multiple reasons (scene destruction on removal from window hierarchy, for example). So it feels like a proper way to do and not just workaround. |
Thanks for the article https://proandroiddev.com/compose-multiplatform-managing-ui-state-on-ios-45d37effeda9 |
We will discuss it. And try to make better solution for all your needs. But it will take some time. |
Thanks for your work guys and for letting the community help! 🙏🏼 |
This might come in handy 😇 |
@elijah-semyonov @dima-avdeev-jb latest release changelog:
😇 |
The absence of a specific type for
androidx.compose.ui.window.ComposeUIViewController
andplatform.UIKit.UIViewController
presents a limitation in usingupdateUIViewController
and, consequently, the associated Composable.In scenarios where the iOS application requires management of Composable state through an iOS ViewModel, the availability of such types would prove to be advantageous:
I find this use-case quite intriguing, particularly in its potential to attract iOS developers and facilitate incremental adoption. Furthermore, it introduces the exciting possibility of incorporating Composables into a project without the necessity of sharing ViewModels. This offers a more flexible approach compared to a full-fledged Composable + ViewModel sharing strategy.
Currently, the workaround I've discovered involves incorporating a
MutableStateFlow
within theComposeUIViewController
, which responds to changes in state properties:on iosApp side:
It works, but it's not very graceful.
The text was updated successfully, but these errors were encountered: