<!--
{
  "documentType" : "article",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/1534504-response-codes",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Response Codes"
}
-->

# Response Codes

Response codes identifying the button that was pressed to dismiss a notification dialog.

## Discussion

To extract this value from the response flags of a dismissed notification (such as returned by [`CFUserNotificationReceiveResponse(_:_:_:)`](/documentation/CoreFoundation/CFUserNotificationReceiveResponse(_:_:_:))), you must perform a bitwise-AND operation between the returned response flags and `0x3` before comparing the value to these constants.

## Topics

### Constants

[`var kCFUserNotificationDefaultResponse: CFOptionFlags`](/documentation/CoreFoundation/kCFUserNotificationDefaultResponse)

The default button was pressed.

[`var kCFUserNotificationAlternateResponse: CFOptionFlags`](/documentation/CoreFoundation/kCFUserNotificationAlternateResponse)

The alternate button was pressed.

[`var kCFUserNotificationOtherResponse: CFOptionFlags`](/documentation/CoreFoundation/kCFUserNotificationOtherResponse)

The third button was pressed.

[`var kCFUserNotificationCancelResponse: CFOptionFlags`](/documentation/CoreFoundation/kCFUserNotificationCancelResponse)

No button was pressed and the notification timed out.



---

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)