---
title: "playPattern(from:)"
framework: corehaptics
role: symbol
role_heading: Instance Method
path: "corehaptics/chhapticengine/playpattern(from:)-6m9m5"
---

# playPattern(from:)

Plays a pattern that’s defined in a file at the specified URL.

## Declaration

```swift
func playPattern(from fileURL: URL) throws
```

## Parameters

- `fileURL`: The URL to the AHAP file containing the haptic event dictionary.

## Discussion

Discussion Start the engine prior to calling this method to provide low-latency playback. If the engine isn’t already running when you call this method, the system starts it, which can result in a significant playback delay.

## See Also

### Playing a Pattern

- [playPattern(from:)](corehaptics/chhapticengine/playpattern(from:)-7u8se.md)
