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

# schedule(in:forMode:)

Adds the receiver to the specified run loop.

## Declaration

```swift
func schedule(in aRunLoop: RunLoop, forMode mode: RunLoop.Mode)
```

## Parameters

- `aRunLoop`: Run loop in which to schedule 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 remove(from:forMode:) to transfer the receiver to a run loop other than the default one. You should not attempt to run the receiver on multiple run loops.

## See Also

### Managing Run Loops

- [remove(from:forMode:)](foundation/netservicebrowser/remove(from:formode:).md)
