无法创建新的日历iOS Swift

问题描述

给出了日历访问权限,并且在try catch“ try catch”中没有抛出日历错误,但是仍然没有创建新的日历。 下面的代码我用来创建日历。

    eventStore.requestAccess(to: .event) { (granted,error) in            
        
        if error != nil {
            return
        }
        
        let calendar = EKCalendar(for: .event,eventStore: self.eventStore)
        calendar.title = "XXX Events"
        calendar.source = self.eventStore.defaultCalendarForNewEvents?.source
        
        do {
            try self.eventStore.saveCalendar(calendar,commit: true)
            self.allEventCallApi(date: Util.getCurrentDateEventApi())
            
        } catch {
            print(error)
        }
    }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)