---
title: "limitDate(forMode:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/runloop/limitdate(formode:)"
---

# limitDate(forMode:)

Performs one pass through the run loop in the specified mode and returns the date at which the next timer is scheduled to fire.

## Declaration

```swift
func limitDate(forMode mode: RunLoop.Mode) -> Date?
```

## Parameters

- `mode`: The run loop mode to search. You may specify custom modes or use one of the modes listed in Run Loop Modes.

## Return Value

Return Value The date at which the next timer is scheduled to fire, or nil if there are no input sources for this mode.

## Discussion

Discussion The run loop is entered with an immediate timeout, so the run loop does not block, waiting for input, if no input sources need processing.

## See Also

### Accessing Run Loops and Modes

- [current](foundation/runloop/current.md)
- [currentMode](foundation/runloop/currentmode.md)
- [main](foundation/runloop/main.md)
- [getCFRunLoop()](foundation/runloop/getcfrunloop().md)
- [RunLoop.Mode](foundation/runloop/mode.md)
