---
title: "wait(for:timeout:)"
framework: xcuiautomation
role: symbol
role_heading: Instance Method
path: "xcuiautomation/xcuiapplication/wait(for:timeout:)"
---

# wait(for:timeout:)

Waits for the application to reach the specified state or timeout.

## Declaration

```swift
func wait(for state: XCUIApplication.State, timeout: TimeInterval) -> Bool
```

## Parameters

- `state`: The requested application state.
- `timeout`: The amount of time to wait, in seconds, for the application to reach the requested application state.

## Return Value

Return Value A Boolean value that indicates whether the app is in the specified state, or can reach the specified state before the timeout.
