xcode 在我的 iPhone 应用程序中使用日历发布事件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5985027/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Using a Calendar in my iPhone Application to Publish Events
提问by ibjazz
I am trying to build an application that shows a Calendar with events that are published by the owner of the application. That is, users that download the application will be able to see the dates of special events and add them to their own calendar.
我正在尝试构建一个应用程序,该应用程序显示带有由应用程序所有者发布的事件的日历。也就是说,下载该应用程序的用户将能够查看特殊事件的日期并将其添加到他们自己的日历中。
Is there a way to do this, or is the only option to do an XML Parsing?
有没有办法做到这一点,或者是进行 XML 解析的唯一选择?
Thanks in advance.
提前致谢。
回答by bobbypage
UIKit.framework
has no API for a UI calendar.
UIKit.framework
没有用于 UI 日历的 API。
There are open source projects for UI calendars like Tapku.
有像Tapku这样的 UI 日历的开源项目。
Tapku's TKCalendarMonthView
mimics the Calender.app UI preloaded on iOS.
TapkuTKCalendarMonthView
模仿 iOS 上预加载的 Calender.app UI。
Using a combination of the Tapku library, XML or JSON parsing, and magic you could fetch special events from your webserver and add them to Tapku's TKCalendarMonthView
to achieve your goal.
使用 Tapku 库、XML 或 JSON 解析和魔法的组合,您可以从您的网络服务器获取特殊事件并将它们添加到 TapkuTKCalendarMonthView
以实现您的目标。
Thanks,
谢谢,
-David
-大卫
回答by Steve Moser
API for UI calendar
UI日历的API
In addition to Tapku bobbypage referenced here is also the KLCalendarView which attempts to look somewhat like Calendar.app (Search for it, I'm out of hyperlinks).
除了这里引用的 Tapku bobbypage 之外,还有 KLCalendarView,它试图看起来有点像 Calendar.app(搜索它,我没有超链接)。
API for adding events to a user's calendar
用于将事件添加到用户日历的 API
Check out Apple's EventKitreference. It allows for adding static and recurring events. Here is a good videotutorial on how to use event kit.
查看 Apple 的EventKit参考。它允许添加静态和重复事件。这是一个关于如何使用事件工具包的很好的视频教程。
XML or JSON parsing
XML 或 JSON 解析
Depends on the source of the calendar. Here is another SO question about paring ics files on the iPhone.
取决于日历的来源。这是另一个关于在 iPhone 上配对 ics 文件的问题。