---
title: "init(dateMatching:repeats:)"
framework: usernotifications
role: symbol
role_heading: Initializer
path: "usernotifications/uncalendarnotificationtrigger/init(datematching:repeats:)"
---

# init(dateMatching:repeats:)

Creates a calendar trigger using the date components parameter.

## Declaration

```swift
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 doc://com.apple.documentation/documentation/Swift/false to deliver the notification one time. Specify doc://com.apple.documentation/documentation/Swift/true to reschedule the notification request each time the system delivers the notification.

## Return Value

Return Value A new calendar trigger based on the specified temporal information.

## Discussion

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.
