---
title: "remove(from:forMode:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmachport/remove(from:formode:)"
---

# remove(from:forMode:)

Removes the receiver from the run loop mode mode of runLoop.

## Declaration

```swift
func remove(from runLoop: RunLoop, forMode mode: RunLoop.Mode)
```

## Parameters

- `runLoop`: The run loop from which to remove the receiver.
- `mode`: The run loop mode from which to remove the receiver.

## Discussion

Discussion When the receiver is removed, the run loop stops monitoring the Mach port for incoming messages.

## See Also

### Scheduling the Port on a Run Loop

- [schedule(in:forMode:)](foundation/nsmachport/schedule(in:formode:).md)
