---
title: "onChanged(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/gesture/onchanged(_:)"
---

# onChanged(_:)

Adds an action to perform when the gesture’s value changes.

## Declaration

```swift
nonisolated func onChanged(_ action: @escaping (Self.Value) -> Void) -> _ChangedGesture<Self>
```

## Parameters

- `action`: The action to perform when this gesture’s value changes. The action closure’s parameter contains the gesture’s new value.

## Mentioned in

Adding interactivity with gestures

## Return Value

Return Value A gesture that triggers action when this gesture’s value changes.

## See Also

### Performing the gesture

- [updating(_:body:)](swiftui/gesture/updating(_:body:).md)
- [onEnded(_:)](swiftui/gesture/onended(_:).md)
- [Value](swiftui/gesture/value.md)
