---
title: data2
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsevent/data2
---

# data2

Additional data associated with this event.

## Declaration

```swift
var data2: Int { get }
```

## Discussion

Discussion The originator of the event defines the data in this property, and the data is dependent on the event type. If the type of this event isn’t  NSAppKitDefined, NSSystemDefined, NSApplicationDefined, or NSPeriodic, accessing this property raises internalInconsistencyException. NSPeriodic events don’t use this property.

## See Also

### Related Documentation

- [subtype](appkit/nsevent/subtype.md)
- [otherEvent(with:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:)](appkit/nsevent/otherevent(with:location:modifierflags:timestamp:windownumber:context:subtype:data1:data2:).md)

### Getting custom event information

- [data1](appkit/nsevent/data1.md)
