Contents

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

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

Declaration

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 1534483 Alert Levels), determine whether radio buttons or checkboxes are to be used (see 1534481 Button Flags), specify which, if any, of these buttons are checked by default (see Cfusernotificationcheckboxchecked(_:)), specify whether any of the text fields are to be secure text fields (see Cfusernotificationsecuretextfield(_:)), and determine which element of a pop-up menu, if present, should be selected by default (see 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 Dialog Description Keys. The dictionary must contain a value for the key Kcfusernotificationalertheaderkey, but the other keys are optional.

Return Value

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

See Also

CFUserNotification Miscellaneous Functions