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
In Swift, to cancel the particular local notification using Unique Key:
func cancelLocalNotification(UNIQUE_ID: String){
var notifyCancel = UILocalNotification()
var notifyArray = UIApplication.sharedApplication().scheduledLocalNotifications
for notifyCancel in notifyArray as! [UILocalNotification]{
let info: NSDictionary = notifyCancel.userInfo as! [String : String]
if info[UNIQUE_ID]!.isEqual(UNIQUE_ID){
UIApplication.sharedApplication().cancelLocalNotification(notifyCancel)
}else{
println("No Local Notification Found!")
}
}
}