我想使用Swift 4和XCode 10.1将事件添加到本机日历中。 我在显示本机界面时遇到问题,该界面的单元格显示错误 谢谢您的回答
let eventStore = EKEventStore()
eventStore.requestAccess( to: EKEntityType.event, completion:{(granted, error) in
DispatchQueue.main.async {
if (granted) && (error == nil) {
let event = EKEvent(eventStore: eventStore)
event.title = "test"
event.location = "test"
event.startDate = Date()
event.endDate = Date()
event.notes = "test Data"
let eventController = EKEventEditViewController()
eventController.event = event
eventController.eventStore = eventStore
eventController.editViewDelegate = self
self.present(eventController, animated: true, completion: nil)
}
}
})
结果: