3

Currently working on an App need set different type of repeat rule of notification

Like repeat everyday, workday, weekday or several days of the week.

var dateInfo = DateComponents()
dateInfo.hour = 7
dateInfo.minute = 0
dateInfo.weekday = 1
let trigger = UNCalendarNotificationTrigger(dateMatching: dateInfo, repeats: true)

Using this API can only add one day of the week at each time, is there any simple way.

appreciated

Dávid Pásztor
  • 51,403
  • 9
  • 85
  • 116
Jin
  • 53
  • 5
  • 2
    There's no easy way to do this. The built in `UNCalendarNotificationTrigger` is quite simple, it doesn't support things such as triggering on several days a week or the concept of workdays/weekdays. You'll manually have to set up several repeating notifications with different triggers for each day to achieve your goals. – Dávid Pásztor May 28 '18 at 14:33
  • @DávidPásztor thanks a lot. guess will do it manually. It really freak out especially you have one notification fire in several times a day – Jin May 28 '18 at 14:49

0 Answers0