我对这段代码有疑问
import UIKit
import EventKit
let eventStore = EKEventStore()
eventStore.requestAccessToEntityType(EKEntityType.Event, completion: { (success, accessError) -> Void in
if accessError != nil {
print("Calendar Access Error: \(accessError)")
return
}
let event = EKEvent(eventStore: eventStore)
event.title = self.detailItem!.title
event.allDay = true
event.startDate = self.detailItem!.date
event.endDate = self.detailItem!.date
event.calendar = eventStore.defaultCalendarForNewEvents
var saveToCalendarError: NSError?
let success: Bool
do {
//Swift2: use of unresolved identifier 'EKSpanThisEvent'
try eventStore.saveEvent(event, span: EKSpanThisEvent)
success = true
} catch var error as NSError {
saveToCalendarError = error
success = false
} catch {
fatalError()
}
编译器无法编译,错误是“使用未解析的标识符'EKSpanThisEvent'”
我希望有人能帮帮忙!