---
title: "requestUserAttention(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsapplication/requestuserattention(_:)"
---

# requestUserAttention(_:)

Starts a user attention request.

## Declaration

```swift
func requestUserAttention(_ requestType: NSApplication.RequestUserAttentionType) -> Int
```

## Parameters

- `requestType`: The severity of the request. For a list of possible values, see doc://com.apple.appkit/documentation/AppKit/NSApplication/RequestUserAttentionType.

## Return Value

Return Value The identifier for the request. You can use this value to cancel the request later using the cancelUserAttentionRequest(_:) method.

## Discussion

Discussion Activating the app cancels the user attention request. A spoken notification will occur if spoken notifications are enabled. Sending requestUserAttention(_:) to an app that is already active has no effect. If the inactive app presents a modal panel, this method will be invoked with NSCriticalRequest automatically. The modal panel is not brought to the front for an inactive app.

## See Also

### Managing user attention requests

- [NSApplication.RequestUserAttentionType](appkit/nsapplication/requestuserattentiontype.md)
- [cancelUserAttentionRequest(_:)](appkit/nsapplication/canceluserattentionrequest(_:).md)
- [reply(toOpenOrPrint:)](appkit/nsapplication/reply(toopenorprint:).md)
- [NSApplication.DelegateReply](appkit/nsapplication/delegatereply.md)
