简体   繁体   English

如何在iOS中仅获取可见日历

[英]How to get only Visible calendars in iOS

I'm trying to get only the visible calendars from iOS using Swift. 我正在尝试使用Swift仅从iOS获取可见日历。 I can get the whole list of available calendars but I cannot know which one is being shown in the device. 我可以获得可用日历的全部列表,但我不知道设备中正在显示哪个日历。 I just want to work with those ones and not creating another list of selected calendars, instead, use the list that is in the system already. 我只想使用那些日历,而不是创建所选日历的另一个列表,而是使用系统中已经存在的列表。

Any one knows if there is any propertie that I can get or any method? 有人知道我是否可以获得任何特性或任何方法? EKCalendar doesn't seem to have any useful one for that matter. EKCalendar在这一问题上似乎没有任何有用的方法。

Any help would be much appreciated. 任何帮助将非常感激。

func ListCalendars() {
        if !AccesToCalendar() { return }

        self.calendarList = MyEvenstore.calendars(for: .event)

        for calendars in calendarList!{
            print(calendars.title)
        }
}

I can figure out that the existing calendars on the systems are the ones configured and all of them are "visible". 我可以弄清楚,系统上的现有日历是已配置的日历,并且所有日历都是“可见的”。 I'm guessing the data from the app calendar where the visbility is configured, is not accesible from another app. 我猜测来自配置可见性的应用程序calendar中的数据无法从另一个应用程序访问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM