<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSEvent/trackingArea",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSEvent(py)trackingArea"
  },
  "title" : "trackingArea"
}
-->

# trackingArea

The tracking area for the event.

```
var trackingArea: NSTrackingArea? { get }
```

## Discussion

If you access this property on an event object that is not a mouse-tracking event — that is, its event type isn’t [`NSMouseEntered`](/documentation/AppKit/NSMouseEntered), [`NSMouseExited`](/documentation/AppKit/NSMouseExited), or [`NSCursorUpdate`](/documentation/AppKit/NSCursorUpdate) —AppKit raises an <doc://com.apple.documentation/documentation/Foundation/NSExceptionName/internalInconsistencyException>.

If the event corresponds to a tracking rectangle installed with the [`addTrackingRect(_:owner:userData:assumeInside:)`](/documentation/AppKit/NSView/addTrackingRect(_:owner:userData:assumeInside:)) method of [`NSView`](/documentation/AppKit/NSView), the value of this property is `nil`. The [`trackingNumber`](/documentation/AppKit/NSEvent/trackingNumber) property contains either an [`NSTrackingArea`](/documentation/AppKit/NSTrackingArea) object or [`NSView.TrackingRectTag`](/documentation/AppKit/NSView/TrackingRectTag), depending on how AppKit generated the event.

---

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)