Hi guys, I have used compose multi-platform for sh...
# compose-ios
a
Hi guys, I have used compose multi-platform for sharing ui between android and iOS in my KMM library. I am using Precompose for handling navigation. The problem is that whenever I present my viewController, it does not respect the device safe area in iOS. Adding some code sample below 👇
Copy code
private val topViewController: UIViewController?
        get() {
            var rootController = UIApplication.sharedApplication.keyWindow?.rootViewController
            while (rootController?.presentedViewController != null) {
                rootController = rootController.presentedViewController
            }
            return  rootController
        }

    private val noobController: UIViewController by lazy {
        PreComposeApplication { NoobScreen() }
    }


    fun toggle() {
        if(!isNoobAlreadyShowing) {
            noobController.modalPresentationStyle = UIModalPresentationFullScreen
            topViewController?.presentViewController(noobController, true, null)
        } else {
            noobController.dismissViewControllerAnimated(true, completion = null)
        }
        isNoobAlreadyShowing = !isNoobAlreadyShowing
    }
r
You are probably ignoring safe area in your swift file
a
In my ios app I just set rootViewController and call my KMM module’s
toggle
function
It would be really helpful if any of you guys can help me with this