Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • In Compose MPP a black screen usally means the transition runs off the main thread or the next UIViewController gets deallocated, it can be fixed by doing the switch on main (Swift: DispatchQueue.main.async { nav.pushViewController(vc, animated: true) } / KMM callback with withContext(Dispatchers.Main)), if you replace window.rootViewController also call window.makeKeyAndVisible(), and keep a strong reference to your root/navigation object (Decompose/Compose) so it isn’t GC’d. But it will be more helpfull if you can also share the iOS-side code that does the screen switch. Commented Nov 12 at 14:06
  • @YassinRebai thank you for your advice. I uploaded code that I used for navigation, and a bug exists between screens in the mainGraph function, only forthe iOS platform Commented Nov 13 at 9:08
  • @YassinRebai, unfortunately, after testing, I see that it's not my case. I do not replace VCs, but I ran tests with makeKeyAndVisible(), + validated that the switch exists in the Main thread and is still able to catch this issue. Commented Nov 14 at 11:48