Swift 4 How to get all events from calendar?
问题 I am using Swift 4.1. And I want to write a function which will collect all events from all calendars in Calendar app of iOS. Thanks to this answer on stackoverflow: How to get all Events out of a Calendar (Swift) I was able to write my own class and call it Cale . Please, look at this: import UIKit import EventKit class Cale { private func createDate(year: Int) -> Date { var components = DateComponents() components.year = year components.timeZone = TimeZone(secondsFromGMT: 0) return Calendar