Hello, I’m working on. CMP with a iOS target Kotli...
# compose-ios
s
Hello, I’m working on. CMP with a iOS target Kotlin: 2.1.20, Compose: 1.8.0-rc01. I’m trying to include a swiftui component within the compose view, I’m following this medium article for implementation. https://cazimirroman.medium.com/mixing-swiftui-and-jetpack-compose-in-a-kotlin-multiplatform-project-for-ios-2f49a47085e7 now this works with these versioning. (see screenshot) what i currently get is a error when I try to view the screen with my native swiftUI controller.
Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<_TtGC7SwiftUI19UIHostingControllerV12SharedApp13TextInputView_: 0x1008a0a00> should have parent view controller:(null) but actual parent is:<ComposeHostingViewController: 0x10122f860>'
So if this is the error, is it a case that I just need an empty UIViewController and add the newly hostedViewController to that? The other hidden context is that this is a bottomsheet
👀 1
1
I can return the .view of the hostingViewController and this will appear in the bottom sheet, but crashes on the “onEditingChange” call back. I can use the approach in the Medium article if I am returning my SwiftUI component into the main compose screen
@Animasahun Ibrahim sorry I notice you put a tick, but did you have any thoughts on this? If I have a compose bottom sheet any swiftUI View I want to use via the UIKitView or UIKitViewController doesn’t work in a bottom sheet scenario. This is currently the issue I’m facing looking for a workaround.