4

I tried to add an alarm (EKAlarm) to a reminder (EKReminder). Almost everything works fine: The reminder is added in the "Reminders.app" and gets fired at the right time.

But somehow (in contrast to a manually created reminder) the firing date/time is not showing in the detail label of the reminder in the "Reminders.app" and it's not appearing in the NotificationCenter as upcoming reminder either.

This is my (slightly abbreviated) code:

// EventStore
var store = EKEventStore()

// Reminder
var reminder = EKReminder(eventStore: store)
reminder.title = "Test"
reminder.calendar = store.defaultCalendarForNewReminders()

// Add alarm to reminder
reminder.addAlarm(EKAlarm(absoluteDate: datePicker.date))

// Add it to Reminders.app
store.saveReminder(reminder, commit: true, error: &error)

Am I missing anything? Thx for your help in advance.

Luca
  • 163
  • 1
  • 5

0 Answers0