We can only use those 5 callbacks on ComposeWindow...
# compose-ios
m
We can only use those 5 callbacks on ComposeWindow? Is there any issue with adding all the methods of UIViewController
i
cc @Elijah Semyonov
e
@mohamed rejeb It’s hard to say if there is an issue with adding all the methods, until we do so. And we only add methods, which users said they need. Do you have an issue posted for adding specific methods that are not there yet and thay you need? Plus, just in case, if it’s a blocker, you can just wrap
ComposeUIViewController
into your own custom subclass of
UIViewController
and override things you need there. So this API is more of a QoL-feature.
thank you color 1
m
It's not a blocker, I just wanted to observe
UIViewController
size. Talking about
ComposeUIViewController
design, can't we have it as an abstract/open class with a method for setting composable content, and then we can override anything we want directly. Not sure if this is possible with Kotlin/Native.
Copy code
class MyUIViewController(): ComposeUIViewController() {
    @Composable
    override fun Content() {
        Text("Hi!")
    }
}
e
What you mean saying
wanted to observe
UIViewController
size
Can you explain your particular usage scenario? It’s possible to override ObjC classes in K/N, but there is a lot of restrictions and unobvious things going on accompanied with not well discoverable workarounds. So when it’s not required we’d better provide more streamlined approach for doing stuff, hence the question in the start of this message.
i
I just wanted to observe
UIViewController
size.
LocalWindowInfo.current.containerSize
m
I'm using
ComposeUIViewController
inside a UIKit bottom sheet and it was working fine until I added partially expanded support. When changing the sheet from partially expanded to expanded or vice versa the Compose content is not recomposed correctly, I wanted to observe the size and recompose it manually (Also
LocalWindowInfo.current.containerSize
doesn't work on this case) What I'm doing now is recomposing the sheet content on each frame which is not the best solution. https://github.com/MohamedRejeb/Calf/blob/main/calf-ui/src/iosMain/kotlin/com/mohamedrejeb/calf/ui/sheet/AdaptiveBottomSheet.ios.kt#L29
e
It’s a bug and it should have been fixed. Can you check on latest build?
kodee happy 1
m
Working fine with the latest 1.7.0 dev build. Thanks!
👍 1