1
我有這樣的代碼:空頭銜,而進口
let calendars = EKEventStore().calendars(for: entityType)
for calendar in calendars {
...
createListFrom(calendar: calendar, entityType: entityType)
}
...
newList.name = calendar.title
在iOS系統10,calendar.title
是真名,但在iOS的11總是nil
。
它是一個iOS 11的錯誤還是我做錯了什麼?
upd。
問題是
讓日曆= EKEventStore()日曆(爲:的EntityType)。
變體
讓eventStore = EKEventStore()
讓日曆= eventStore.calendars( for:.event)
作品
我使用完全相同的代碼。 –
你是否要求權限? –
是的,代碼適用於iOS 10 –