Hi, Everyone, Is there any way to NOT TO Provide ...
# compose
i
Hi, Everyone, Is there any way to NOT TO Provide Modifier(size/layout kind of modifiers) to the UIKitViewController, So that NativeButton of IOS takes as large as its label Currently, If not provided, View is not visible either In swift code, I am using SwiftUI Button View via UIHostingController as the NativeButton
Copy code
@Composable
actual fun NativeButton(
    label: String,
    onClick: () -> Unit,
    modifier: Modifier
) {
    val factory = LocalNativeViewFactory.current

    val onSizeChange: (Double, Double) -> Unit = { w, h ->
        println("Width: $w, Height: $h")
    }

    UIKitViewController(
        factory = { factory.createNativeButton(label, onClick, onSizeChange) },
        modifier = Modifier.fillMaxWidth().height(20.dp)
    )
}
Something like
Copy code
@Composable
actual fun NativeButton(
    label: String,
    onClick: () -> Unit,
    modifier: Modifier
) {
    val factory = LocalNativeViewFactory.current

    val onSizeChange: (Double, Double) -> Unit = { w, h ->
        println("Width: $w, Height: $h")
    }

    UIKitViewController(
        factory = { factory.createNativeButton(label, onClick, onSizeChange) }
    )
}