comment faire pour annuler une localNotification avec la presse d'un bouton dans swift?

Je suis la planification d'un emplacement en fonction UILocalNotification avec le clic d'un bouton . Mais quand j'essaie d'annuler la localNotification en cliquant sur le même bouton de nouveau, il n'a pas d'annuler la notification.
Je suis à l'aide de UIApplication.sharedApplication().cancelLocalNotification(localNotification)
pour annuler mon prévue fonction de la localisation de notification locale.
Ce que je fais mal ?
voici ma mise en œuvre

@IBAction func setNotification(sender: UIButton!) {
    if sender.tag == 999 {
        sender.setImage(UIImage(named: "NotificationFilled")!, forState: .Normal)
        sender.tag = 0
        regionMonitor() //function where notification get scheduled

    } else {
        sender.setImage(UIImage(named: "Notification")!, forState: .Normal)
        sender.tag = 999 }

que dois-je entrer dans le bloc else ainsi que la date prévue de notification sera annulé. Ne peut pas effacer toutes les notifications.
voici la didEnterRegion bloc de code où je déclencher la notification locale

func locationManager(manager: CLLocationManager!, didEnterRegion region: CLRegion!) {
    localNotification.regionTriggersOnce = true
    localNotification.alertBody = "Stack Overflow is great"
    UIApplication.sharedApplication().scheduleLocalNotification(localNotification)
    NSLog("Entering region")
}

OriginalL'auteur sumesh | 2015-08-11