Protocol

CHHapticAdvancedPatternPlayer

A protocol that defines an advanced pattern player capable of looping, seeking, pausing, and resuming haptic playback.

Declaration

@protocol CHHapticAdvancedPatternPlayer

Overview

Create instances of this pattern player through a CHHapticEngine object by calling a factory method such as createAdvancedPlayerWithPattern:error:. When you ask an advanced pattern player to play, pause, or resume a haptic pattern, the player submits those commands to the haptic engine on your behalf.

Unlike CHHapticPatternPlayer, the advanced pattern player supports looping of haptic and audio patterns, by setting loopEnabled. The advanced pattern player can also call a block when the player finishes, through its completionHandler property.

Topics

Setting Playback Properties

loopEnabled

A Boolean that determines whether the haptic repeats itself on completion.

Required.

loopEnd

The time at which to end looping haptic playback.

Required.

playbackRate

The playback rate of the haptic player.

Required.

completionHandler

A completion block that runs after the haptic finishes playing.

Required.

CHHapticAdvancedPatternPlayerCompletionHandler

A typealias for the completion handler to run after a haptic finishes playback.

Controlling Playback

- pauseAtTime:error:

Pauses the haptic player during playback.

Required.

- resumeAtTime:error:

Resumes playing a paused haptic.

Required.

- seekToOffset:error:

Jumps to the specified offset time in playing the haptic.

Required.

Silencing Haptic Playback

isMuted

A Boolean that silences all haptic and audio output from the player when set to YES.

Required.

Relationships

See Also

Creating Haptic Pattern Players

CHHapticPatternPlayer

A protocol that defines a standard pattern player capable of playing haptic patterns with fixed parameters.

- createPlayerWithPattern:error:

Creates a standard haptic pattern player from a haptic pattern.

- createAdvancedPlayerWithPattern:error:

Creates an advanced haptic pattern player from a haptic pattern.