An object that describes a single haptic or audio event.
- iOS 13.0+
- Mac Catalyst 13.0+
- Core Haptics
Each event represents a single haptic or audio signal. The event
type determines whether it is audio or haptic. Use a
CHHaptic object obtained through
CHHaptic 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.
Specify when an event begins by setting its
relative 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