---
title: "swipe"
description: "Performs the swipe gesture on the associated node. The motion events are linearly interpolated
between [start] and [end]. The coordinates are in the node's local coordinate system, where
(0, 0) is the top left corner of the node. The default duration is 200 milliseconds."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


> **Deprecated** Replaced by TouchInjectionScope. Use `performTouchInput` instead of `performGesture`

```kotlin
fun GestureScope.swipe(start: Offset, end: Offset, durationMillis: Long = 200) =
    delegateScope.touch { swipe(start, end, durationMillis) }
```


Performs the swipe gesture on the associated node. The motion events are linearly interpolated
between `start` and `end`. The coordinates are in the node's local coordinate system, where
(0, 0) is the top left corner of the node. The default duration is 200 milliseconds.

#### Parameters

| | |
| --- | --- |
| start | The start position of the gesture, in the node's local coordinate system |
| end | The end position of the gesture, in the node's local coordinate system |
| durationMillis | The duration of the gesture |




<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun TouchInjectionScope.swipe(start: Offset, end: Offset, durationMillis: Long = 200)
```


Performs a swipe gesture on the associated node.

The motion events are linearly interpolated between `start` and `end`. The coordinates are in the
node's local coordinate system, where (0, 0) is the top left corner of the node. The default
duration is 200 milliseconds.

#### Parameters

| | |
| --- | --- |
| start | The start position of the gesture, in the node's local coordinate system |
| end | The end position of the gesture, in the node's local coordinate system |
| durationMillis | The duration of the gesture |




<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun TouchInjectionScope.swipe(
    curve: (timeMillis: Long) -> Offset,
    durationMillis: Long = 200,
    keyTimes: List<Long> = emptyList(),
)
```


Performs a swipe gesture on the associated node.

The swipe follows the `curve` from 0 till `durationMillis`. Will force sampling of an event at
all times defined in `keyTimes`. The time between events is kept as close to
`eventPeriodMillis` as possible, given the constraints. The
coordinates are in the node's local coordinate system, where (0, 0) is the top left corner of the
node. The default duration is 200 milliseconds.

#### Parameters

| | |
| --- | --- |
| curve | The function that describes the gesture. The argument passed to the function is the time in milliseconds since the start of the swipe, and the return value is the location of the pointer at that point in time. |
| durationMillis | The duration of the gesture |
| keyTimes | An optional list of timestamps in milliseconds at which a move event must be sampled |




