SensoryFeedbackFlexibility
The flexibility to be represented by a type of feedback.
StructureiOS 17.0+macOS 14.0+tvOS 17.0+watchOS 10.0+visionOS 26.0+SensoryFeedback.Flexibility in SwiftUI
Declaration
type SensoryFeedbackFlexibility = 'rigid' | 'soft' | 'solid';struct FlexibilityPass a literal, or build one with SwiftUI.SensoryFeedbackFlexibility from import { SwiftUI } from 'swiftui-react-native'.
Type properties
'rigid'SwiftUI.SensoryFeedbackFlexibility.rigidIndicates a collision between hard or inflexible UI objects.
'soft'SwiftUI.SensoryFeedbackFlexibility.softIndicates a collision between soft or flexible UI objects.
'solid'SwiftUI.SensoryFeedbackFlexibility.solidIndicates a collision between solid UI objects of medium flexibility.
Overview
Flexibility values can be passed to
SensoryFeedback.impact(flexibility:intensity:).
From Apple’s SwiftUI documentation. Code samples there are Swift.
See also
More in Input and interaction.
- ButtonRepeatBehaviorThe options for controlling the repeatability of button actions.
- KeyboardShortcutKeyboard shortcuts describe combinations of keys on a keyboard that the user can press in order to activate a button or toggle.
- KeyboardShortcutLocalizationOptions for how a keyboard shortcut participates in automatic localization.
- PencilPreferredActionAn action that the user prefers to perform after double-tapping their Apple Pencil.
- SensoryFeedbackRepresents a type of haptic and/or audio feedback that can be played.
- SensoryFeedbackPressFeedbackFeedback that can be played in response to a press (touch down) on a control.
- SensoryFeedbackReleaseFeedbackFeedback that can be played in response to a release (touch up) of a control.
- SensoryFeedbackWeightThe weight to be represented by a type of feedback.