https://kotlinlang.org logo
#compose-ios
Title
# compose-ios
a

Ahmed Mourad

09/22/2023, 10:00 PM
hey guys, i'm getting this weird flashing when transitioning between screens, i'm using ComposeUIViewControllers that i'm embedding into UIKit UIViewControllers 1:1, i've tried changing the background of the root controllers and of the navigation controller root view but nothing changed, any ideas?
a

Alexander Zhirkevich

09/23/2023, 8:30 AM
It was patched. Update compose to the latest version
a

Ahmed Mourad

09/23/2023, 12:00 PM
@Alexander Zhirkevich I'm on compose 1.5.1, is it patched in a snapshot?
a

Alexander Zhirkevich

09/23/2023, 12:15 PM
Hm, it should work well in 1.5.1 https://github.com/JetBrains/compose-multiplatform-core/pull/766 May be @Elijah Semyonov knows more
👀 1
d

Dima Avdeev

09/23/2023, 9:00 PM
Does both screen written in Compose ?
a

Ahmed Mourad

09/23/2023, 9:22 PM
@Dima Avdeev Each of the screens is a swift UIViewController that only has a ComposeUIViewController embedded into it full screen and nothing else. In
viewDidLoad
of each of the swift controllers I call this:
Copy code
@OptIn(ExperimentalForeignApi::class)
fun UIViewController.embed(controller: UIViewController, into: UIView) {
    this.addChildViewController(controller)
    into.addSubview(controller.view)
    controller.view.setFrame(into.bounds)
    controller.didMoveToParentViewController(this)
}
and I pass it the compose controller and the root view
d

Dima Avdeev

09/24/2023, 12:58 AM
Well, this scenario in currently not in our main goal. First of all we want to support single ComposeUIViewController. In you case you can merge 2 screens into one ComposeUIViewController.
👍 1
a

Ahmed Mourad

09/24/2023, 1:34 AM
@Dima Avdeev Main reason i'm going with this is to have the system nav bar at the top as well as the swipe back gestures for navigation, is it possible to have those with a single compose controller?
e

Elijah Semyonov

09/25/2023, 3:17 PM
The fix wasn’t included in the last released version. Should be there on
1.5.10
. This scenario (integrating ComposeUIViewController into native Navigation/Modal controllers) was the target for this fix.
a

Ahmed Mourad

09/25/2023, 3:59 PM
@Elijah Semyonov Nice!! thank you!
4 Views