I am utilizing the brand new AlarmKit framework to construct a Swift app that lets customers schedule a number of repeating alarms.
The purpose is to permit customers to cease all alarms for as we speak in the event that they get up early, however the alarms ought to nonetheless ring on their scheduled days sooner or later (for instance, each Monday).
What I attempted: When the consumer chooses to cease alarms for as we speak, I delete all alarms and re-add them. Nonetheless, this does not work as anticipated.
If as we speak is Monday and I delete and re-add the alarm with .weekday = .monday, it nonetheless rings as we speak. Which means re-adding the alarm would not skip as we speak’s occasion, despite the fact that it is repeating.
What I wish to obtain: Skip or suppress as we speak’s alarms when the consumer stops them manually
Maintain the identical alarms lively for his or her scheduled days sooner or later
Questions: Is there a means in AlarmKit to stop a repeating alarm from ringing as we speak if it was simply re-added or there are higher alternate options to this drawback?
Is the one workaround to delay re-adding till after as we speak’s alarms would have fired?
What’s the greatest method to realize this?