Repeat method in EventKit Framework?

I can access all the functions of EKEventStore, for example, save any event or delete any event from the Calendar.

But how to create snooze for this event, say, 15 minutes ago for all saveEvent?

I did not find out how such a method

Does anyone know such a method?

+4
source share
2 answers

If you try to execute some function in your application after a 15 second delay, you can use something like this:

[self performSelector:@selector(yourMethod) withObject:nil afterDelay:15]; 

EventKit is designed to set local notifications for the user, which can be shown whether the user will launch your application or not. They are exactly reminiscent of push notifications, except that they are stored locally on the user device and do not require a network connection.

If you are trying to add a snooze function to an EventKit notification, you can implement it in your application using the ApplicationDidLoadWithOptions method. This method is called whenever the user clicks the OK button in his local notification. As far as I know, there are no built-in snooze functions in the EventKit infrastructure.

0
source

I have never tried this library, but have you tried NSTimer ? Sort of:

 NSTimer *snoozeTimer; //make it reachable in whole class //setting the snooze timer. 900 s = 15 min. change to "repeats:NO" if you want just one snooze. snoozeTimer = [NSTimer scheduledTimerWithTimeInterval:900.0 target:self selector:@selector(someAlarmMethod) userInfo:nil repeats:YES]; //and after finished snooze [snoozeTimer invalidate]; 

This may not be what you are looking for, but it might work :)

-1
source

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


All Articles