1

The notification will be triggered in i.e 25-7-2017 using: UNCalendarNotificationTrigger(dateMatching: dueDate , repeats: false)

How can I repeat the notification every month i.e 25-8-2017, 25-9-2017 and so on.

  • 1
    Possible duplicate of [iOS Notification Trigger: fortnightly and/or quarterly](https://stackoverflow.com/questions/41441124/ios-notification-trigger-fortnightly-and-or-quarterly) – mfaani Jul 19 '17 at 20:29

1 Answers1

3

Instead of providing a full date when you initialize the trigger, pass a set of DateComponents containing only the day of the month, and set repeats to true.

let components = DateComponents(day: 25)
let trigger = UNCalendarNotificationTrigger(dateMatching: components, repeats: true)
Robert
  • 6,660
  • 5
  • 39
  • 62