来自本机 iPad 日历的事件
我想从本机 iPad 日历获取事件(如生日、假期等),是否有机会做到这一点?
谢谢。 罗马
i want to get events (like a birthday, holidays and etc.) from native iPad calendar, whether there's any chance do it?
Thanks.
Roman
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 EventKit 框架,您可以访问日历并读取用户数据。您可以此处找到 Apple 的官方文档。 SimpleEKDemo 源代码对我确实很有帮助。
如果您喜欢视频教程,您可能需要参考 这个。
如果您想要访问用户地址簿中与联系人详细信息一起保存的人员的出生日期,但不在日历中,则 AddressBookUI 框架 是您的选择。
然而,如果您的目标是法定假期,则需要寻找外部来源。默认情况下不支持法定节假日,很可能是因为各个国家(甚至州与州)的节假日有所不同。 Apple 提供了一些 iCal 日历文件,其中包含大多数国家/地区的节假日。
With the EventKit framework you can access the calender and read the user's data. You will find Apple's official documentation here. The SimpleEKDemo source code was really helpful to me.
If you like video tutorials, you might want to refer to this one.
If you want to access the birth dates of people in the user's address book that are saved with the contact details, but not in the calendar, the AddressBookUI framework is your choice.
Tf you are however targeting legal holidays, you will need to find an external source. Legal holidays are not supported by default, most likely because they differ from country to country (or even state to state). Apple provides some iCal calendar files with holidays of most countries.