I'm trying to trigger local notification on specific day of weekday, but all my attempts have failed, the notification should be triggered on specific time of weekday, but instead it's triggered immediately, I searched all possible solutions in stack overflow but non of those answers have solved my problem, how I can solve this problem?
func combineDate(time:NSDate,dayIndex:Int) -> NSDate {
let calendar: NSCalendar = NSCalendar.currentCalendar()
let components: NSDateComponents = calendar.components([.Year, .Month, .WeekOfYear, .Weekday], fromDate: time)
let component1 = NSDateComponents()
component1.weekday = dayIndex
component1.minute = components.minute
component1.hour = components.hour
let combinedDate: NSDate = calendar.dateFromComponents(component1)!
return combinedDate
}