How can I skip the first occurrence of a repeating UNCalendarNotificationTrigger?

Say today it's Monday and 1 o’clock. I want to schedule a weekly local notification from my iOS application starting today at 2 p.m. I would do this:

NSDateComponents *components = [[[NSDateComponents alloc]init]autorelease]; components.weekday = 2; components.hour = 14; components.minute = 0; UNCalendarNotificationTrigger *trigger = [UNCalendarNotificationTrigger triggerWithDateMatchingComponents:components repeats:YES]; //then make a UNMutableNotificationContent and UNNotificationRequest and schedule it 

But if I want to start it next Monday at 2 a.m., how to skip the first entry?

To ask the question in a different way, how do I assign a repeating UNCalendarNotificationTrigger starting at some arbitrary time, instead of the first occurrence of the repeating interval?

+12
source share

Source: https://habr.com/ru/post/1013735/


All Articles