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

# remove(from:forMode:)

Removes the receiver from the specified run loop.

## Declaration

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

## Parameters

- `aRunLoop`: Run loop from which to remove the receiver.
- `mode`: Run loop mode in which to perform this operation, such as doc://com.apple.foundation/documentation/Foundation/RunLoop/Mode/default. See the Run Loop Modes section of the doc://com.apple.foundation/documentation/Foundation/RunLoop class for other run loop mode values.

## Discussion

Discussion You can use this method in conjunction with schedule(in:forMode:) to transfer the receiver to a run loop other than the default one. Although it is possible to remove an NSNetService object completely from any run loop and then attempt actions on it, you must not do it.

## See Also

### Managing Run Loops

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