Geek Culture
Published in

Geek Culture

Recurring Reminders With Swift in iOS development

Photo by Towfiqu barbhuiya on Unsplash

Creating a Recurring Reminder

Recurrence Rule

EKRecurrenceRule(recurrenceWith: .weekly, interval: 1, daysOfTheWeek: [.init(.monday),.init(.tuesday)], daysOfTheMonth: nil, monthsOfTheYear: nil, weeksOfTheYear: nil, daysOfTheYear: nil, setPositions: nil, end: .none)
EKRecurrenceRule(recurrenceWith: .yearly, interval: 1, daysOfTheWeek: [.init(.monday), .init(.tuesday), .init(.wednesday), .init(.thursday), .init(.friday)], daysOfTheMonth: nil, monthsOfTheYear: nil, weeksOfTheYear: nil, daysOfTheYear: nil, setPositions: [1,-1], end: .none)
  1. dueDateComponents: Date Components of Date by which reminder should be completed. Similarly one can add startDateComponents as well. But dueDateComponents is mandatory when creating a recurring reminder.
  2. EKAlarm: While adding EKAlarm, it is recommended to use offset which is relative to due date.

Updating a Recurring Reminder

Completing Recurring Reminder

Removing Recurring Reminder

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sai Durga Mahesh

Using Data Science to provide better solutions to real word problems