Modifiers
onLongPressGesture
Adds a long press gesture recognizer.
onLongPressGesture(handler, minimumDuration)
| Parameter | Type | Description |
|---|---|---|
handler | () => void | Function to call when long pressed. |
minimumDuration(optional) | number | Minimum duration for long press (default: 0.5s) |
Adds a long press gesture recognizer.
Returns: ModifierConfig
Works with
This modifier works with any view. These components accept it:
- VStack
- HStack
- ZStack
- LazyVStack
- LazyHStack
- Group
- Spacer
- Divider
- Overlay
- ScrollView
- Button
- Toggle
- Checkbox
- Slider
- Picker
- DatePicker
- ColorPicker
- Link
- ControlGroup
- Menu
- ContextMenu
- TextField
- SecureField
- Text
- Label
- Image
- List
- Form
- Section
- DisclosureGroup
- SwipeActions
- BottomSheet
- Alert
- ConfirmationDialog
- Popover
- ProgressView
- Gauge
- TabView
- AccessoryWidgetBackground
Sources
The original Expo docs for this page:
- onLongPressGesture (Modifiers) (
source-of-truth/versions/v57.0.0/sdk/ui/swift-ui/modifiers.md)
onGeometryChange
Calls the handler whenever the view's geometry changes, with its position and size. x and y are in the global coordinate space (relative to the window); all values are in points.
onScrollPhaseChange
Fires when SwiftUI's scroll phase changes (e.g., the user begins dragging, the scroll view starts decelerating, or scrolling settles to idle). The second argument is the scroll geometry sampled at the phase transition, useful for reading the final offset on settle without subscribing to per-frame onScrollGeometryChange.