CHHapticEvent
An object that describes a single haptic or audio event.
Declaration
class CHHapticEventOverview
Each event represents a single haptic or audio signal. The event type determines whether it’s audio or haptic. Use a CHHapticPatternPlayer object obtained through CHHapticEngine factory methods to play events. Haptic events can be transient or continuous. Transient haptic patterns are brief impulses that occur at a specific point in time, such as the haptic feedback you feel from swiping through a picker or toggling a switch. Continuous haptic patterns, like the vibration from a ringtone, take the form of lengthier feedback over a period of time.
In the following graphic, transient haptic patterns on the left trigger at a specific time with a specific intensity. Continuous haptic patterns on the right sustain the haptic feedback over a specific duration of time, such as three seconds.
[Image]
Specify when an event begins by setting its relativeTime property. Specify the length of the event by setting its duration property. Set optional parameters to customize event properties. For example, you can specify the intensity of a haptic event by creating an event parameter with ID hapticIntensity.
Topics
Categorizing Haptic Events
Creating Haptic Events
init(audioResourceID:parameters:relativeTime:)init(audioResourceID:parameters:relativeTime:duration:)init(eventType:parameters:relativeTime:)init(eventType:parameters:relativeTime:duration:)