是否可以将单个Gradle任务添加到多个组?
这一行:
let dateFormatter = DateFormatter()
dateFormatter.dateStyle = .short
dateFormatter.dateFormat = "YYYY-MM-dd"
let startDATE = dateFormatter.date(from: routineDate)
let endDATE = dateFormatter.date(from: routineDate)
print(routineDate)
if temptypeID == "1" {
let event:EKEvent = EKEvent(eventStore: appleEventStore)
event.title = tempDescription
// what should i need to change here for specific date and time?
event.startDate = (startDATE?.addingTimeInterval(60*60))!
event.endDate = (endDATE?.addingTimeInterval(60*60))!
event.isAllDay = false
event.notes = "This is a note"
event.calendar = cal
do {
try appleEventStore.save(event, span: .thisEvent)
print("events added with dates:")
// what should changes i need to do here for alert ?
let alarm = EKAlarm(absoluteDate: Date(timeInterval: -3600, since: event.startDate))
event.addAlarm(alarm)
} catch let e as NSError {
print(e.description)
return
}
print("Saved Event")
}
答案 0 :(得分:1)
不,这是不可能的。任务只能分配给一个组。 The setter method for the property also just takes a String.