---
title: stoppedHandler
framework: corehaptics
role: symbol
role_heading: Instance Property
path: corehaptics/chhapticengine/stoppedhandler-swift.property
---

# stoppedHandler

A closure the haptic engine calls when it stops due to external causes.

## Declaration

```swift
var stoppedHandler: CHHapticEngine.StoppedHandler { get set }
```

## Mentioned in

Preparing your app to play haptics

## Discussion

Discussion External causes that can cause the system to call this closure include audio session interruptions, app suspensions, or system errors. Calling stop(completionHandler:) doesn’t invoke this callback. Callbacks to this closure don’t occur on the main thread, so handle them in a thread-safe manner.

## See Also

### Handling Haptic Engine Stoppages

- [CHHapticEngine.StoppedHandler](corehaptics/chhapticengine/stoppedhandler-swift.typealias.md)
- [CHHapticEngine.StoppedReason](corehaptics/chhapticengine/stoppedreason.md)
