---
title: "motionEnded(_:with:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiresponder/motionended(_:with:)"
---

# motionEnded(_:with:)

Tells the responder that a motion event has ended.

## Declaration

```swift
func motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?)
```

## Parameters

- `motion`: An event-subtype constant indicating the kind of motion. A common motion is shaking, which is indicated by doc://com.apple.uikit/documentation/UIKit/UIEvent/EventSubtype/motionShake.
- `event`: An object representing the event associated with the motion.

## Discussion

Discussion UIKit informs the responder only when a motion event starts and ends. It doesn’t report intermediate shakes. Motion events are delivered initially to the first responder and are forwarded up the responder chain as appropriate The default implementation of this method forwards the message up the responder chain.

## See Also

### Responding to motion events

- [motionBegan(_:with:)](uikit/uiresponder/motionbegan(_:with:).md)
- [motionCancelled(_:with:)](uikit/uiresponder/motioncancelled(_:with:).md)
