使用唯一标识符创建 EKEvent(不可编辑)
Creating EKEvent with Unique Identifier(Not Editable)
我想创建一个 EKEvent 以将其添加到设备日历中。有什么方法可以为此事件设置唯一 ID(用户无法在日历应用程序中编辑),以便我可以识别它或将其与我的事件匹配。
我正在创建这样的活动
let event = EKEvent.init(eventStore: eventStore)
event.title = "My location"
event.location = "Location Address"
// Setting Start - End Date
event.startDate = Date()
event.endDate = Date()
do {
// Saving Events
try eventStore.save(event, span: .thisEvent, commit: true)
let message = "Schedule has been added to your device's calendar."
showAlert(title: kFVApplicationTitle, message: message)
} catch {
let message = "Schedule could not be added to your device's calendar."
showAlert(title: kFVApplicationTitle, message: message)
}
为 EKEvent 创建类别并在其中添加其他属性解决了我的问题。
我想创建一个 EKEvent 以将其添加到设备日历中。有什么方法可以为此事件设置唯一 ID(用户无法在日历应用程序中编辑),以便我可以识别它或将其与我的事件匹配。
我正在创建这样的活动
let event = EKEvent.init(eventStore: eventStore)
event.title = "My location"
event.location = "Location Address"
// Setting Start - End Date
event.startDate = Date()
event.endDate = Date()
do {
// Saving Events
try eventStore.save(event, span: .thisEvent, commit: true)
let message = "Schedule has been added to your device's calendar."
showAlert(title: kFVApplicationTitle, message: message)
} catch {
let message = "Schedule could not be added to your device's calendar."
showAlert(title: kFVApplicationTitle, message: message)
}
为 EKEvent 创建类别并在其中添加其他属性解决了我的问题。