Snooze method in EventKit Framework?
I am able to access all functionality of EKEventStore like save any event or remove any event from Calendar.
But how can create snooze for that event lets say 15 min snooze i needed for all saveEvent ?
I didn't find out as such 开发者_JAVA百科method
Anyone know such method ?
If you are trying to set some function in your application to be performed after a fifteen second delay, you could use something like this:
[self performSelector:@selector(yourMethod) withObject:nil afterDelay:15];
EventKit is intended to set local notifications for the user that can be shown whether the user is running your application or not. They are exactly like push notifications, except they are stored locally on the user's device and don't require a network connection.
If you are are trying to add a snooze function to an EventKit notification, you could implement it in your application using the ApplicationDidLoadWithOptions method. That method is called whenever the user clicks the "OK" button on your local notification. As far as I know, there is no built in snooze functionality in the EventKit framework itself.
I've never tried that library, but have you tried NSTimer
? Something like:
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];
Maybe it's not what you're looking for, but it might work :)
精彩评论