NEW: My new book Pro SwiftUI is out now – level up your SwiftUI skills today! >>

Get Reminders List and update View in the right way

Forums > SwiftUI


Hello, I want that the user can choose a list from the Reminders app where some should be saved.

Now, I get the Reminder-Lists like this:

func fetchReminderLists() -> [EKCalendar] {
        let reminderLists = eventStore.calendars(for: .reminder)
        var listFromUser: [EKCalendar] = []

        for list in reminderLists {

        return listFromUser

In my SwiftUI View, I have a Picker where the Reminder-List should be displayed:

 @AppStorage("selected_reminder_list_id") var selectedReminderListId: String = ""
    @State private var reminderList: [EKCalendar] = []

Picker(selection: $selectedReminderListId) {
                                    if selectedReminderListId == "" {
                                        Text("No list selected")
                                        ForEach(reminderList, id: \.self) { reminderList in
                                    } else {
                                        ForEach(reminderList, id: \.self) { reminderList in
                                } label: {
                                    HStack {
                                        Image(systemName: "list.bullet")
                                            .padding(.trailing, 4)

.onAppear {
                    reminderList = ReminderManager.shared.fetchReminderLists()
                    var found = false

                    for i in 1...reminderList.count {
                        if reminderList[i - 1].calendarIdentifier == selectedReminderListId {
                            found = true

                    if !found {
                        selectedReminderListId = ""

Now my question is, how can I listen to changes in the Reminders-App for example when a lists get deleted or added. Also is there a better solution for the Picker?

Thank you for your help!


Have you read this page in the documentation?



Thanks, you also know how to respond to list changes, not just create or delete. The problem is that the view with this observer only updates for a newly created list in the reminders app or a deleted one, not for an edited one.


You are observing for EKEventStoreChanged? Per the docs: "This notification is posted whenever changes are made to the Calendar database, including adding, removing, and changing events or reminders." (emphasis added)


Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until October 1st.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.