<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIResponder/motionEnded(_:with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIResponder(im)motionEnded:withEvent:"
  },
  "title" : "motionEnded(_:with:)"
}
-->

# motionEnded(_:with:)

Tells the responder that a motion event has ended.

```
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 [`UIEvent.EventSubtype.motionShake`](/documentation/UIKit/UIEvent/EventSubtype/motionShake).

`event`

An object representing the event associated with the motion.

## 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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)