I’ve been having some issues closing the iOS keybo...
# multiplatform
b
I’ve been having some issues closing the iOS keyboard. I have
Copy code
ComposeView()
  .ignoresSafeArea(.keyboard)
However after a lot of searching it doesn’t seem like any scroll to dismiss solution works. What have other people done for this?
j
you can create a custom modifier that uses a customised
detectDragGestures
function which does not consume touch events when you detect a drag gesture, hide the software keyboard this doesn’t give the same UX as native iOS but the overall behaviour will be similar
b
It doesn’t seem like there’s any native-like ways to do this and I don’t know enough about iOS dev to create my own
a
If you’re doing things like this be careful about testing on different iOS versions. Maybe this is only a SwiftUI issue but I had a lot of woes recently with custom ways to detect focus changes, that worked fine on iOS18 but not 17 or 16.
b
I experienced this also. I ended up not finding a good solution to this so I’m being careful with all of my text to make sure they have keyboard actions