<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreHaptics",
  "identifier" : "/documentation/CoreHaptics/CHHapticEvent",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Haptics"
    ],
    "preciseIdentifier" : "c:objc(cs)CHHapticEvent"
  },
  "title" : "CHHapticEvent"
}
-->

# CHHapticEvent

An object that describes a single haptic or audio event.

```
class CHHapticEvent
```

## Overview

Each event represents a single haptic or audio signal. The event [`type`](/documentation/CoreHaptics/CHHapticEvent/type) determines whether it’s audio or haptic. Use a [`CHHapticPatternPlayer`](/documentation/CoreHaptics/CHHapticPatternPlayer) object obtained through [`CHHapticEngine`](/documentation/CoreHaptics/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.

![A transient haptic pattern on the left, and a continuous haptic pattern on the right.](images/com.apple.corehaptics/media-3235483@2x.png)

Specify when an event begins by setting its [`relativeTime`](/documentation/CoreHaptics/CHHapticEvent/relativeTime) property. Specify the length of the event by setting its [`duration`](/documentation/CoreHaptics/CHHapticEvent/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`](/documentation/CoreHaptics/CHHapticEvent/ParameterID/hapticIntensity).

## Topics

### Categorizing Haptic Events

[`type`](/documentation/CoreHaptics/CHHapticEvent/type)

The type of the haptic event.

[`EventType`](/documentation/CoreHaptics/CHHapticEvent/EventType)

The types of audio and haptic event waveforms.

### Creating Haptic Events

[`-  initWithAudioResourceID:parameters:relativeTime:`](/documentation/CoreHaptics/CHHapticEvent/init(audioResourceID:parameters:relativeTime:))

Initializes a haptic event from a previously loaded audio resource, specifying event parameters and start time.

[`-  initWithAudioResourceID:parameters:relativeTime:duration:`](/documentation/CoreHaptics/CHHapticEvent/init(audioResourceID:parameters:relativeTime:duration:))

Initializes a haptic event from a previously loaded audio resource, specifying event parameters, start time, and duration.

[`-  initWithEventType:parameters:relativeTime:`](/documentation/CoreHaptics/CHHapticEvent/init(eventType:parameters:relativeTime:))

Initializes a haptic event of the specified type, parameters, and start time.

[`-  initWithEventType:parameters:relativeTime:duration:`](/documentation/CoreHaptics/CHHapticEvent/init(eventType:parameters:relativeTime:duration:))

Initializes a haptic event of the specified type, parameters, start time, and duration.

### Configuring Haptic Events

[`eventParameters`](/documentation/CoreHaptics/CHHapticEvent/eventParameters)

An array of event parameters, possibly empty.

[`ParameterID`](/documentation/CoreHaptics/CHHapticEvent/ParameterID)

An identifier for an event parameter.

[`relativeTime`](/documentation/CoreHaptics/CHHapticEvent/relativeTime)

The start time of the event, relative to other events in the same pattern.

[`duration`](/documentation/CoreHaptics/CHHapticEvent/duration)

The duration of the haptic event.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)