I have a chat app with a ScrollView for messages and an input bar placed in .safeAreaInset(edge: .bottom). I'm using .scrollDismissesKeyboard(.interactively) which works great for dismissing the keyboard when scrolling the message content area.

However, the interactive dismiss only triggers when dragging within the ScrollView bounds. It only registers when my finger hits the top of the keyboard, not the input. The input bar sits between the messages and the keyboard (in the safe area inset), and dragging down from the input bar area does NOT trigger the interactive keyboard dismissal.

In iMessage, dragging down from the input bar area smoothly dismisses both the input bar and keyboard together because the input bar is a UITextView.inputAccessoryView.

How can I achieve this same behavior in SwiftUI? Is there a way to make the input bar participate in the interactive keyboard dismiss, or do I need to use inputAccessoryView via UIKit?

evan's user avatar

1

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.