---
title: CFUserNotification
framework: Core Foundation
role: symbol
role_heading: Class
path: corefoundation/cfusernotification
---

# CFUserNotification

## Declaration

```swift
class CFUserNotification
```

## Overview

Overview A CFUserNotification object presents a simple dialog on the screen and optionally receives feedback from the user. The contents of the dialog can include a header, a message, an icon, text fields, a pop-up button, radio buttons or checkboxes, and up to three ordinary buttons. Use CFUserNotification in processes that do not otherwise have user interfaces, but may need occasional interaction with the user. You create a user notification with the CFUserNotificationCreate(_:_:_:_:_:) function. You pass in a dictionary whose keys describe the items to place into the dialog. (See Dialog Description Keys for the list of keys.) A set of flags passed to the function determines, among other things, whether secure text fields are used (such as for password fields), whether radio buttons or checkboxes are used, and which of these buttons are checked by default. You can also specify a timeout for the dialog, in which case the dialog cancels itself if the user does not respond in the allotted time period. A user notification displays its dialog as soon as it is created. If any reply is required, it may be awaited in one of two ways: either synchronously, using CFUserNotificationReceiveResponse(_:_:_:), or asynchronously, using a run loop source created with CFUserNotificationCreateRunLoopSource(_:_:_:_:). CFUserNotificationReceiveResponse(_:_:_:) has a timeout parameter that determines how long it will block (zero meaning indefinitely) and it may be called as many times as necessary until a response arrives. If a user notification has not yet received a response, it may be updated with new information or it may be cancelled. User notifications may not be reused. CFUserNotification provides two convenience functions, CFUserNotificationDisplayNotice(_:_:_:_:_:_:_:_:) and CFUserNotificationDisplayAlert(_:_:_:_:_:_:_:_:_:_:_:), to display very basic dialogs that either require no response from the user or require only a single button to be pressed, respectively.

## Topics

### CFUserNotification Miscellaneous Functions

- [CFUserNotificationCancel(_:)](corefoundation/cfusernotificationcancel(_:).md)
- [CFUserNotificationCheckBoxChecked(_:)](corefoundation/cfusernotificationcheckboxchecked(_:).md)
- [CFUserNotificationCreate(_:_:_:_:_:)](corefoundation/cfusernotificationcreate(_:_:_:_:_:).md)
- [CFUserNotificationCreateRunLoopSource(_:_:_:_:)](corefoundation/cfusernotificationcreaterunloopsource(_:_:_:_:).md)
- [CFUserNotificationDisplayAlert(_:_:_:_:_:_:_:_:_:_:_:)](corefoundation/cfusernotificationdisplayalert(_:_:_:_:_:_:_:_:_:_:_:).md)
- [CFUserNotificationDisplayNotice(_:_:_:_:_:_:_:_:)](corefoundation/cfusernotificationdisplaynotice(_:_:_:_:_:_:_:_:).md)
- [CFUserNotificationGetResponseDictionary(_:)](corefoundation/cfusernotificationgetresponsedictionary(_:).md)
- [CFUserNotificationGetResponseValue(_:_:_:)](corefoundation/cfusernotificationgetresponsevalue(_:_:_:).md)
- [CFUserNotificationGetTypeID()](corefoundation/cfusernotificationgettypeid().md)
- [CFUserNotificationPopUpSelection(_:)](corefoundation/cfusernotificationpopupselection(_:).md)
- [CFUserNotificationReceiveResponse(_:_:_:)](corefoundation/cfusernotificationreceiveresponse(_:_:_:).md)
- [CFUserNotificationSecureTextField(_:)](corefoundation/cfusernotificationsecuretextfield(_:).md)
- [CFUserNotificationUpdate(_:_:_:_:)](corefoundation/cfusernotificationupdate(_:_:_:_:).md)

### Callbacks

- [CFUserNotificationCallBack](corefoundation/cfusernotificationcallback.md)

### Constants

- [Alert Levels](corefoundation/1534483-alert-levels.md)
- [Response Codes](corefoundation/1534504-response-codes.md)
- [Button Flags](corefoundation/1534481-button-flags.md)
- [Alert Levels](corefoundation/1534483-alert-levels.md)
- [Response Codes](corefoundation/1534504-response-codes.md)
- [Button Flags](corefoundation/1534481-button-flags.md)
- [Dialog Description Keys](corefoundation/dialog-description-keys.md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)

## See Also

### Opaque Types

- [CFAllocator](corefoundation/cfallocator.md)
- [CFArray](corefoundation/cfarray.md)
- [CFAttributedString](corefoundation/cfattributedstring.md)
- [CFBag](corefoundation/cfbag.md)
- [CFBinaryHeap](corefoundation/cfbinaryheap.md)
- [CFBitVector](corefoundation/cfbitvector.md)
- [CFBoolean](corefoundation/cfboolean.md)
- [CFBundle](corefoundation/cfbundle.md)
- [CFCalendar](corefoundation/cfcalendar.md)
- [CFCharacterSet](corefoundation/cfcharacterset.md)
- [CFData](corefoundation/cfdata.md)
- [CFDate](corefoundation/cfdate.md)
- [CFDateFormatter](corefoundation/cfdateformatter.md)
- [CFDictionary](corefoundation/cfdictionary.md)
- [CFError](corefoundation/cferror.md)
