Class

CHHapticEventParameter

A static parameter value that represents a single property of the haptic pattern.

Declaration

class CHHapticEventParameter : NSObject

Overview

Event parameters specify values for haptics associated with the event. For example, an intensity event parameter determines how intense the haptic feels when it fires. Event parameters are static; they don't change over the course of the pattern. To change a parameter value after a haptic has started playing, use a CHHapticDynamicParameter to make an immediate change, or a CHHapticParameterCurve to transition smoothly.

A rising blue line represents how a parameter curve changes the parameter's value gradually over time, while an orange line shows how dynamic parameters change the parameter's value immediately.

When you send a dynamic parameter to the haptic pattern, its value changes immediately, at the specified time. When you send a parameter curve instead, the value changes gradually according to the type of curve you specified.

Topics

Creating an Event Parameter

init(parameterID: CHHapticEvent.ParameterID, value: Float)

Creates a haptic event parameter from its ID and value.

struct CHHapticEvent.ParameterID

An identifier that indicates the event parameter being defined.

Specifying an Event Parameter's Value

var parameterID: CHHapticEvent.ParameterID

The haptic parameter ID indicating what type of parameter the current event represents.

var value: Float

The value of the parameter.

Relationships

Inherits From

Conforms To

See Also

Programmatic Haptics

Playing Collision-Based Haptic Patterns

Play a custom haptic pattern whose strength depends on an object’s collision speed.

Updating Continuous and Transient Haptic Parameters in Real Time

Generate continuous and transient haptic patterns in response to user touch.

class CHHapticEvent

An object that describes a single haptic or audio event.

Beta
class CHHapticDynamicParameter

A value that you send to a haptic pattern player to alter a property value during playback.

Beta
class CHHapticParameterCurve

A curve that you send to a haptic pattern player to alter a property value gradually during playback.

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software