<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSApplication/requestUserAttention(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSApplication(im)requestUserAttention:"
  },
  "title" : "requestUserAttention(_:)"
}
-->

# requestUserAttention(_:)

Starts a user attention request.

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

## Parameters

`requestType`

The severity of the request. For a list of possible values, see [`NSApplication.RequestUserAttentionType`](/documentation/AppKit/NSApplication/RequestUserAttentionType).

## Return Value

The identifier for the request. You can use this value to cancel the request later using the [`cancelUserAttentionRequest(_:)`](/documentation/AppKit/NSApplication/cancelUserAttentionRequest(_:)) method.

## Discussion

Activating the app cancels the user attention request. A spoken notification will occur if spoken notifications are enabled. Sending [`requestUserAttention(_:)`](/documentation/AppKit/NSApplication/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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)