Ich mag eine lokale Benachrichtigung Jeder Stunde (nur für einen Tag) senden mit verschiedener Nachricht. Wollen Sie auch die vorherige Benachrichtigung ablehnen, wenn neue kommt.iOS Intervall Lokale Benachrichtigung mit unterschiedlichen Nachrichten
I Gebraucht Dieser Code But The seccond Mitteilung Kommt mit dem gleichen Text wie erste! und macht die vorherigen nicht Entlassen ...
UIApplication.sharedApplication().cancelAllLocalNotifications()
var Text = "!!!!!!!!!"
let Texts = [
"11111111111",
"22222222222",
"33333333333",
"44444444444",
"55555555555"
]
Text = Texts[Int(arc4random_uniform(UInt32(Texts.count)))]
let localNotification:UILocalNotification = UILocalNotification()
localNotification.alertAction = "Testing notifications on iOS8"
localNotification.alertBody = Text
localNotification.fireDate = NSDate(timeIntervalSinceNow: 1)
localNotification.soundName = UILocalNotificationDefaultSoundName
UIApplication.sharedApplication().scheduleLocalNotification(localNotification)
let localNotification2:UILocalNotification = UILocalNotification()
localNotification2.alertAction = "Testing notifications on iOS8"
localNotification2.alertBody = Text
localNotification2.fireDate = NSDate(timeIntervalSinceNow: 5)
localNotification2.soundName = UILocalNotificationDefaultSoundName
UIApplication.sharedApplication().scheduleLocalNotification(localNotification2)