EKEventStore on Apple Watch is not giving me all calendars. I can see only calendars of the source 'Subscriptions', but non of the calendars of source CalDAV (iCloud).
This problem exists over multiple apps. Code works fine on iPhone. Any ideas?
Minimal example code:
import SwiftUI
import EventKit
struct ContentView: View {
let eventStore = EKEventStore()
@State var success: Bool = false
@State var calendarNames: [String] = [String]()
func request() async {
success = (try? await eventStore.requestFullAccessToEvents()) ?? false
}
func list() {
calendarNames = eventStore.calendars(for: .event).map { $0.title }
}
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Access: \(success.description)")
ScrollView {
ForEach(calendarNames, id: \.self) { name in
Text(name)
}
}
}
.onAppear {
Task {
await request()
list()
}
}
.padding()
}
}