Class

CHHapticPattern

An object representing a haptic waveform.

Declaration

@interface CHHapticPattern : NSObject

Overview

A haptic pattern represents the waveform of a haptic through a hierarchical set of key-value pairs, starting at the topmost level with a CHHapticPatternKey key. This key marks the beginning of an array of events and CHHapticPatternKeyParameterID definitions. Each event has an associated time that indicates when the system will deliver the event to the haptic engine.

A diagram showing the contents of a pattern: its keys, values, and subdictionaries.

These key-value pairs represent not only events constituting the pattern, but also individual parameters of each event, which are characteristics of the haptic, such as sharpness and intensity. More complicated patterns also contain key-value pairs for parameter curves, which you can use to modulate parameters over time.

Topics

Creating a Haptic Pattern

- initWithEvents:parameterCurves:error:

Constructs a haptic pattern from a series of events and parameter curves.

- initWithEvents:parameters:error:

Constructs a haptic pattern from a series of events and parameters.

- initWithDictionary:error:

Creates a haptic pattern from a property list dictionary.

CHHapticPatternKey

The structural representation of a key to the pattern dictionary.

Retrieving Haptic Pattern Duration

duration

The duration of the haptic pattern, in seconds.

Exporting a Haptic Pattern

- exportDictionaryAndReturnError:

Returns the dictionary representation of the haptic pattern.

Relationships

Inherits From

See Also

Essentials

Preparing Your App to Play Haptics

Set up your app to play haptics.

Playing a Single-Tap Haptic Pattern

Create and play a transient haptic pattern from a dictionary literal inline.

CHHapticEngine

An object that manages your app's requests to play haptic patterns.