One Logo Pool Ball
SwiftUI · IOS API REFERENCE

ScrollDismissesKeyboardMode

struct · iOS 16.0+ · SDK 27.1

struct ScrollDismissesKeyboardMode

The ways that scrollable content can interact with the software keyboard. Use this type in a call to the ``View/scrollDismissesKeyboard(_:)`` modifier to specify the dismissal behavior of scrollable views.

Members (4)

get · iOS 16.0+

immediately

TypeScript
static get immediately(): ScrollDismissesKeyboardMode
Swift declaration
static var immediately: ScrollDismissesKeyboardMode { get }

Dismiss the keyboard as soon as scrolling starts.

get · iOS 16.0+

interactively

TypeScript
static get interactively(): ScrollDismissesKeyboardMode
Swift declaration
static var interactively: ScrollDismissesKeyboardMode { get }

Enable people to interactively dismiss the keyboard as part of the scroll operation. The software keyboard's position tracks the gesture that drives the scroll operation if the gesture crosses into the keyboard's area of the display. People can dismiss the keyboard by scrolling it off the display, or reverse the direction of the scroll to cancel the dismissal.

get · iOS 16.0+

never

TypeScript
static get never(): ScrollDismissesKeyboardMode
Swift declaration
static var never: ScrollDismissesKeyboardMode { get }

Never dismiss the keyboard automatically as a result of scrolling.

get · iOS 16.0+

automatic

TypeScript
static get automatic(): ScrollDismissesKeyboardMode
Swift declaration
static var automatic: ScrollDismissesKeyboardMode { get }

Determine the mode automatically based on the surrounding context. By default, a ``TextEditor`` is interactive while a ``List`` of scrollable content always dismiss the keyboard on a scroll, when linked against iOS 16 or later.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUI types →