SensoryFeedback
Represents a type of haptic and/or audio feedback that can be played.
Declaration
type SensoryFeedback =
| 'alignment'
| 'decrease'
| 'error'
| 'impact'
| 'increase'
| 'levelChange'
| 'pathComplete'
| 'selection'
| 'start'
| 'stop'
| 'success'
| 'warning'
| { impact: { flexibility: SensoryFeedbackFlexibility; intensity?: number; }; }
| { impact: { weight?: SensoryFeedbackWeight; intensity?: number; }; }
| { press: SensoryFeedbackPressFeedback; }
| { release: SensoryFeedbackReleaseFeedback; }
| { selection: SensoryFeedbackSelectionFeedback; };struct SensoryFeedbackPass a literal, or build one with SwiftUI.SensoryFeedback from import { SwiftUI } from 'swiftui-react-native'.
Type properties
'alignment'SwiftUI.SensoryFeedback.alignmentIndicates the alignment of a dragged item.
'decrease'SwiftUI.SensoryFeedback.decreaseIndicates that an important value decreased below a significant threshold.
'error'SwiftUI.SensoryFeedback.errorIndicates that an error has occurred.
'impact'SwiftUI.SensoryFeedback.impactProvides a physical metaphor you can use to complement a visual experience.
'increase'SwiftUI.SensoryFeedback.increaseIndicates that an important value increased above a significant threshold.
'levelChange'SwiftUI.SensoryFeedback.levelChangeIndicates movement between discrete levels of pressure.
'pathComplete'SwiftUI.SensoryFeedback.pathCompleteIndicates a drawn path has completed and/or recognized.
'selection'SwiftUI.SensoryFeedback.selectionIndicates that a UI element’s values are changing.
'start'SwiftUI.SensoryFeedback.startIndicates that an activity started.
'stop'SwiftUI.SensoryFeedback.stopIndicates that an activity stopped.
'success'SwiftUI.SensoryFeedback.successIndicates that a task or action has completed.
'warning'SwiftUI.SensoryFeedback.warningIndicates that a task or action has produced a warning of some kind.
Type methods
Overview
This feedback can be passed to View.sensoryFeedback to play it.
From Apple’s SwiftUI documentation. Code samples there are Swift.
Used by
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.
- SensoryFeedbackFlexibilityThe flexibility to be represented by a type of feedback.
- 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.