---
title: cancel()
framework: corehaptics
role: symbol
role_heading: Instance Method
path: corehaptics/chhapticpatternplayer/cancel()
---

# cancel()

Stops the pattern player immediately and returns the specified error.

## Declaration

```swift
func cancel() throws
```

## See Also

### Starting and Stopping Playback

- [start(atTime:)](corehaptics/chhapticpatternplayer/start(attime:).md)
- [stop(atTime:)](corehaptics/chhapticpatternplayer/stop(attime:).md)
