curioustechizen
02/06/2024, 11:51 AMcurioustechizen
02/06/2024, 12:04 PMcurioustechizen
02/06/2024, 1:58 PM@Composable fun MyComposable(
mainContent: @Composable () -> Unit,
bottomStickyContent: @Composable () -> Unit
) {
// My Implementation
}
curioustechizen
02/06/2024, 1:58 PMiosMain
) like this:
// Wrapper for use from SwiftUI
fun MyComposableEntryPoint(
createMainContent: () -> UIView,
createBottomStickyContent: () -> UIView
): UIViewController {
ComposeUIViewController {
MyComposable(
mainContent = {
UIKitView(
factory = createMainContent()
)
},
bottomStickyContent = {
UIKitView(
factory = createBottomStickyContent()
)
}
)
}
}
curioustechizen
02/06/2024, 1:58 PM// Usage from SwiftUI
Main_iosKt.MyComposableEntryPoint(
createMainContent: { () -> UIView in
// SwiftUI implementation of mainContent
},
createBottomStickyContent: { () -> UIView in
// SwiftUI implementation of bottomStickyContent
}
)
curioustechizen
02/06/2024, 1:59 PMUIViewControllerRepresentable
step. All of this is just theory. Will have to try it out tomorrow.curioustechizen
02/07/2024, 10:52 AMSwiftUIInUIView
as shown here results in every "slot" taking up the entire screen.
• I tried to make some changes like not setting the autolayout constraints to take up the full space. This solves one problem but still another remains: My slots are not sized correctly.
So my question is: Is it at all possible for a Composable to impose sizing constraints on a SwiftUI view embedded inside it?