i have a local notification that i am repeating every 60s:
var trigger = UNTimeIntervalNotificationTrigger(timeInterval: 60, repeats: true);
i want to change the repeats
value of the UNTimeIntervalNotificationTrigger
from true
to false
if a certain condition is met i.e.:
if (condition) {
trigger!.repeats = true;
}
however this doesn't seem to work as i dont think i can change the repeats
value after creating the object.
is there any way to do what i'm trying to do?
You can remove the local notification as
UIApplication.shared.cancelAllLocalNotifications()
And if you want to true
again then again assign
trigger = UNTimeIntervalNotificationTrigger(timeInterval: 60, repeats: true)
May be this Work