<!--
{
  "availability" : [
    "macOS: 10.8.0 - 11.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSUserNotificationCenterDelegate/userNotificationCenter(_:shouldPresent:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(pl)NSUserNotificationCenterDelegate(im)userNotificationCenter:shouldPresentNotification:"
  },
  "title" : "userNotificationCenter(_:shouldPresent:)"
}
-->

# userNotificationCenter(_:shouldPresent:)

Sent to the delegate when the user notification center has decided not to present your notification.

```
optional func userNotificationCenter(_ center: NSUserNotificationCenter, shouldPresent notification: NSUserNotification) -> Bool
```

## Parameters

`center`

The user notification center.

`notification`

The user notification object.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the user notification should be displayed regardless; <doc://com.apple.documentation/documentation/Swift/false> otherwise.

## Discussion

---

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)