---
title: "CFUserNotificationCreate(_:_:_:_:_:)"
framework: Core Foundation
role: symbol
role_heading: Function
platforms: [macOS 10.0+]
path: "corefoundation/cfusernotificationcreate(_:_:_:_:_:)"
---

# CFUserNotificationCreate(_:_:_:_:_:)

Creates a CFUserNotification object and displays its notification dialog on screen.

## Declaration

```swift
func CFUserNotificationCreate(_ allocator: CFAllocator!, _ timeout: CFTimeInterval, _ flags: CFOptionFlags, _ error: UnsafeMutablePointer<Int32>!, _ dictionary: CFDictionary!) -> CFUserNotification!
```

## Parameters

- `allocator`: The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.
- `timeout`: The time to wait before the notification dialog dismisses itself if the user does not respond. If 0, the notification never times out.
- `flags`: A set of flags describing the type of notification to display. These flags specify an alert level for the notification (see doc://com.apple.corefoundation/documentation/CoreFoundation/1534483-alert-levels), determine whether radio buttons or checkboxes are to be used (see doc://com.apple.corefoundation/documentation/CoreFoundation/1534481-button-flags), specify which, if any, of these buttons are checked by default (see doc://com.apple.corefoundation/documentation/CoreFoundation/CFUserNotificationCheckBoxChecked(_:)), specify whether any of the text fields are to be secure text fields (see doc://com.apple.corefoundation/documentation/CoreFoundation/CFUserNotificationSecureTextField(_:)), and determine which element of a pop-up menu, if present, should be selected by default (see doc://com.apple.corefoundation/documentation/CoreFoundation/CFUserNotificationPopUpSelection(_:)). Combine these flags together by performing a bitwise-OR operation with all the individual flags.
- `error`: On return contains an integer error code. If 0, the user notification was successfully created and displayed.
- `dictionary`: A description of the elements to display in the notification dialog. The possible keys are listed in doc://com.apple.corefoundation/documentation/CoreFoundation/dialog-description-keys. The dictionary must contain a value for the key doc://com.apple.corefoundation/documentation/CoreFoundation/kCFUserNotificationAlertHeaderKey, but the other keys are optional.

## Return Value

Return Value The new CFUserNotification object. Ownership follows the The Create Rule.

## See Also

### CFUserNotification Miscellaneous Functions

- [CFUserNotificationCancel(_:)](corefoundation/cfusernotificationcancel(_:).md)
- [CFUserNotificationCheckBoxChecked(_:)](corefoundation/cfusernotificationcheckboxchecked(_:).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)
