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


class CHHapticParameterCurve : NSObject


Parameter curves serve the same purpose as dynamic parameters in that they alter a property value during playback. Unlike dynamic parameters, which change a property value instantaneously, parameter curves interpolate linearly between parameter values to ensure a smooth transition.

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.

For example, a parameter curve for haptic intensity modulates the intensity over time, ensuring a smooth transition between the current intensity and the upcoming one. Parameter curves apply to all events in a pattern; it isn't possible to apply one to only a single event.


Creating a Curve

class CHHapticParameterCurve.ControlPoint

A single control point in a parameter curve.

Describing the Curve

var controlPoints: [CHHapticParameterCurve.ControlPoint]

An array containing the curve's control points.

var parameterID: CHHapticDynamicParameter.ID

The parameter ID defining the type of parameter that the curve represents.

var relativeTime: TimeInterval

The time at which this parameter curve is applied, relative to the start time of the pattern.


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.

class CHHapticEventParameter

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

class CHHapticDynamicParameter

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