Cancel UILocalNotification

后端 未结 10 926
余生分开走
余生分开走 2020-11-27 12:53

I have a problem with my UILocalNotification.

I am scheduling the notification with my method.

- (void) sendNewNoteLocalReminder:(NSDate *)date  a         


        
10条回答
  •  借酒劲吻你
    2020-11-27 13:32

    Thank @viggio24 for the good answer, this is a swift version

    var notifyCancel = UILocalNotification()
    var notifyArray=UIApplication.sharedApplication().scheduledLocalNotifications
    var i = 0
    while(i {
                if let s = info["name"] {
                    if(name==s){//name is the the one you want cancel
                        notifyCancel = notify
                        break
                    }
                }
            }
        }
    i++
    }
    

提交回复
热议问题