I am trying to send a local notifications on every Monday. Let say that I have a scenario in which I have to send a medication taking reminder on every Monday for one month. So it will be total 4 notification in a month. My code is as below but I can't figure out the following things; 1)How to send the notifications on a specific day 2)How to limit the notification for a max end date.
The code for sending the notification is as follows;
let notification = UILocalNotification()
notification.alertBody = "Take Medication" notification.alertAction = "open" // text that is displayed after "slide to..." on the lock screen - defaults to "slide to view"
notification.fireDate = NSDate()
notification.userInfo = ["title": "notification app", "UUID": "Some Unique Guid"]
UIApplication.sharedApplication().scheduleLocalNotification(notification)
Can anyone please help? Regards, neena
Add the NSWeekCalendarUnit to NSDateComponents and set the repeatInterval to NSWeekCalendarUnit. For Example :