swift - How to repeat and end repeat local notification is iOS 10? -
the system app 'reminder' can set repeat , end repeat, ios 10usernotification.framework
not support function. using uncalendarnotificationtrigger
push local notification. how can implement repeat , end repeat function? thanks.
let datec = calendar.current.datecomponents([.day, .hour, .minute], from: startdate!) let trigger = uncalendarnotificationtrigger(datematching: datec, repeats: true) let content = unmutablenotificationcontent() content.title = "title" content.body = "body" let request = unnotificationrequest(identifier: testidentifier, content: content, trigger: trigger) center.add(request) { (error) in if let error = error { print(error) return } print("scheduled") }
Comments
Post a Comment