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.
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.
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)