<!--
{
  "availability" : [
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFUserNotificationCancel(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFUserNotificationCancel"
  },
  "title" : "CFUserNotificationCancel(_:)"
}
-->

# CFUserNotificationCancel(_:)

Cancels a user notification dialog.

```
func CFUserNotificationCancel(_ userNotification: CFUserNotification!) -> Int32
```

## Parameters

`userNotification`

The user notification to cancel.

## Return Value

`0` if the cancel was successful; a non-`0` value otherwise.

## Discussion

You must cancel a user notification if you want to remove its dialog from the screen before the user dismisses it. It is not sufficient to just release the object.

---

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)