-4

在我的项目中,我需要显示日历列表,用户可以在其中选择一个,根据选择我需要从设备日历应用程序中获取事件。有没有办法像下图一样显示默认日历列表,或者我应该自定义视图

https://www.systutorials.com/136133/changeing-iphone-holiday-calendar-local-one/holiday-calendar-iphone-us/

请帮助解决这个问题。

4

3 回答 3

1

要在您想要使用的屏幕截图中显示视图EKCalendarChooser。您可以通过 指定响应用户选择的行为EKCalendarChooserDelegate。在此处查看 Apple 的文档:https ://developer.apple.com/documentation/eventkitui/ekcalendarhooser

于 2019-09-13T14:32:11.813 回答
0
     let calendars =EventStore.calendars(for entityType:.Events)

// 获取事件

    let eventStore = EventsManager.getEventStore()



    var tempArray:[EKEvent] = []



    let predicate = eventStore.predicateForEvents(withStart: startdate, end: endDate, calendars: calendars)//nil will include all the calendars

    let events = eventStore.events(matching: predicate) as [EKEvent]

要从日历中获取会议,请使用此“使用表格视图和部分创建您自己的 UI 并请求日历的权限”。然后使用 .

于 2018-02-22T20:22:50.540 回答
0

您是否曾经尝试使用 Cocoa pod,其中有大量日历 pod,您只需导入即可轻松使用。

  1. JTApple日历

  2. 日历

  3. XCalender

您还可以查看更多内容。

单击此cocoapods以获取更多可可豆荚示例。

于 2018-01-16T18:48:56.273 回答