Has anyone found an equivalent of `WindowInsets.is...
# compose-ios
c
Has anyone found an equivalent of
WindowInsets.isImeVisible
on iOS?
i
It's android-only API Please file feature request to https://youtrack.jetbrains.com/newIssue?project=CMP with description of your use case. Thanks
👍🏽 1
s
You can check the value of
WindowInsets.ime
, if it's non-zero, then the IME is visible.
Copy code
@Composable
fun keyboardVisibilityAsState(): State<Boolean> {
    val isImeVisible = WindowInsets.ime.getBottom(LocalDensity.current) > 0
    return rememberUpdatedState(isImeVisible)
}
This is what I use in my apps, works pretty well.
👍🏽 1