Initializer

init(dateMatching:repeats:)

Creates a calendar trigger from the specified date components.

Declaration

convenience init(dateMatching dateComponents: DateComponents, repeats: Bool)

Parameters

dateComponents

The temporal information to use when constructing the trigger. Provide only the date components that are relevant for your trigger.

repeats

Specify false to deliver the notification one time. Specify true to reschedule the notification request each time the notification is delivered.

Return Value

A new calendar trigger based on the specified temporal information.

Discussion

If you specify true for the repeats parameter, you must explicitly remove the notification request to stop the delivery of the associated notification. Use the methods of UNUserNotificationCenter to remove notification requests that are no longer needed.