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

# schedule(in:forMode:)

This method should be implemented by a subclass to set up monitoring of a port when added to a given run loop in a given input mode.

## Declaration

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

## Parameters

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

## Discussion

Discussion This method should not be called directly.

## See Also

### Port monitoring

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