I am trying to figure out how to setup a UILocalNotification in swift but I am not having a lot of luck. I am trying this:
var notification = UILocalNotification
func setupNotificationReminder() {
var title:String = "Your reminder text goes here"
let calendar = NSCalendar.currentCalendar()
let calendarComponents = NSDateComponents()
calendarComponents.hour = 7
calendarComponents.second = 0
calendarComponents.minute = 0
calendar.timeZone = NSTimeZone.defaultTimeZone()
var dateToFire = calendar.dateFromComponents(calendarComponents)
// create a corresponding local notification
let notification = UILocalNotification()
let dict:NSDictionary = ["ID" : "your ID goes here"]
notification.userInfo = dict as! [String : String]
notification.alertBody = "\(title)"
notification.alertAction = "Open"
notification.fireDate = dateToFire
notification.repeatInterval = .Day // Can be used to repeat the notification
notification.soundName = UILocalNotificationDefaultSoundName
UIApplication.sharedApplication().scheduleLocalNotification(notification)
}