---
title: "removeMonitor(_:)"
framework: appkit
role: symbol
role_heading: Type Method
path: "appkit/nsevent/removemonitor(_:)"
---

# removeMonitor(_:)

Removes the specified event monitor.

## Declaration

```swift
class func removeMonitor(_ eventMonitor: Any)
```

## Parameters

- `eventMonitor`: The event handler object to remove.

## Discussion

Discussion You must ensure that eventMonitor is removed only once. Removing the same eventMonitor instance multiple times results in an over-release condition, even in a Garbage Collected environment

## See Also

### Monitoring app events

- [addGlobalMonitorForEvents(matching:handler:)](appkit/nsevent/addglobalmonitorforevents(matching:handler:).md)
- [addLocalMonitorForEvents(matching:handler:)](appkit/nsevent/addlocalmonitorforevents(matching:handler:).md)
