let dateComponents1 = calendar!.components([NSCalendarUnit.Day, NSCalendarUnit.WeekOfMonth, NSCalendarUnit.Month,NSCalendarUnit.Year,NSCalendarUnit.Hour,NSCalendarUnit.Minute], fromDate:date)
dateComponents1.month = 5
dateComponents1.day = 12
dateComponents1.hour = 20
dateComponents1.minute = 00
let notification1 = UILocalNotification()
notification1.alertAction = "notification1"
notification1.alertBody = "notification1"
notification1.repeatInterval = NSCalendarUnit.WeekOfYear
notification1.fireDate = calendar!.dateFromComponents(dateComponents1)
UIApplication.sharedApplication().scheduleLocalNotification(notification1)
let dateComponents2 = calendar!.components([NSCalendarUnit.Day, NSCalendarUnit.WeekOfMonth, NSCalendarUnit.Month,NSCalendarUnit.Year,NSCalendarUnit.Hour,NSCalendarUnit.Minute], fromDate:date)
dateComponents2.month = 5
dateComponents2.day = 13
dateComponents2.hour = 14
dateComponents2.minute = 00
let notification2 = UILocalNotification()
notification2.alertAction = "notification2"
notification2.alertBody = "notification2"
notification2.repeatInterval = NSCalendarUnit.WeekOfYear
notification2.fireDate = calendar!.dateFromComponents(dateComponents2)
UIApplication.sharedApplication().scheduleLocalNotification(notification2)
I am trying to have 2 notifications fired at specific time every week. This is how I implement the notifications. 2 notifications fire 8 pm Thursday and Friday 2 pm every week. Am I doing it right? Sometimes I receive duplicate notifications at fire time.