I pull down a list of meeting dates from a server to my app. I parse through all of them and save them as NSDates.
It’s easier to give a use case:
- User pulls down meeting dates
- User navigates to another section of the app
- If it is 15min until a respective meeting time, display an alert in whichever view they are in.
I have all of the above working except for a method to notify the app a time is about to start.
I am guessing this is the perfect time for NSNotificationCenter.
So my question is if I have an array of NSDates, how to constantly monitor if one 15 away?
Use below code to schedule a notification:
Just give firedate = (date_saved-15minutes)
Do this too declare a property localNotification in appdelegate.h and intercept notification then like below: