I have the following code
我有以下代码
@IBAction func triggerNotif(sender: UIButton) {
let dateComp:NSDateComponents = NSDateComponents()
dateComp.year = 2015
dateComp.month = 11
dateComp.day = 12
dateComp.hour = 21
dateComp.minute = 30
dateComp.timeZone = NSTimeZone.systemTimeZone()
let calender:NSCalendar = NSCalendar(calendarIdentifier: NSCalendarIdentifierGregorian)!
let date:NSDate = calender.dateFromComponents(dateComp)!
let notification:UILocalNotification = UILocalNotification()
notification.alertBody = "body of notification"
notification.fireDate = date
notification.repeatInterval = NSCalendarUnit.Day
UIApplication.sharedApplication().scheduleLocalNotification(notification)
}
@IBAction