UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

getting calendar data stopped working with Sonoma upgrade

Forums > SwiftUI

I've been using code from Paul to get calendar info from my local calendar for about two years. Today with the upgrade to macOS Sonoma, it stopped getting the info.

it doesn't crash. it just leaves everything blank.

I doublechecked the permissions in macOS > settings > privacy & security > calendar to make sure it allows full access.

here's the function that worked until this morning at 10am:

    func goGetTheMenu() {
        eventStore.requestAccess(to: .event) { granted, error in
            storeAccessGranted = granted

            if granted {
                todayEvents = events(from: Date.startOfToday, to: Date.endOfToday)
                tomorrowEvents = events(from: Date.startOfTomorrow, to: Date.endOfTomorrow)
                laterEvents = events(from: Date.startOfLater, to: Date.endOfMenu)
            } else {
                print("---------------------------------> calendar access denied")
            }
        }
    }

I added the print statement to see if that's where it is failing, and it appears to be the spot.

Also I started getting notified that the app is from an unidentified developer. It worked fine before the upgrade, and I am definitely identified. Any ideas or suggestions?

thanks!

2      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out more

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.