I would like to, after a certain amount of time e.g. when an object reaches a certain age, change the repeat interval to every other day. How would I go about doing this?
It’s not possible to do this directly. There are two issues:
Your only option would be to calculate the times that you want each of the repeats to fire and then schedule non-repeating notifications for each one. There’s two gotchas with this:
Calculating dates into the future is tricky. NSCalendar will do the work, but you have to be very careful how you use it. It’s very easy to introduce subtle bugs that only crop up in odd circumstances (like daylight saving time changes).
There’s a relatively low limit to how many local notifications you can schedule (last I checked it was 64), which puts a bound on how effective this is.
Finally, depending on the nature of your product, you could change tack and put the events in the user’s calendar. EventKit has a lot more flexibility when it comes to repeating events.
Share and Enjoy
—
Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"