How to get built-in calendars using Swift?

45 Views Asked by At

I want to get subscription calendar ('USOS' calendar from screenshot) but I can't filter built-in calendars such as 'US Holidays' or 'Święta w Polsce'. So my question is how to filter built-in calendars in other way than just filtering their name.

Screenshot from calendar:

Screenshot from calendar

After getting full access to events I'm doing this to get calendars

var calendars = eventStore.calendars(for: .event)

Then I tried to filter results with:

calendars = calendars.filter { $0.type == .subscription }

But there is still calendar 'Święta w Polsce'.

I also tried properties such as 'allowsContentModifications', 'isSubscribed' and 'isImmutable' but for 'Święta w Polsce' and subscription calendar all these properties have the same value.

0

There are 0 best solutions below