swift - 从 Swift 应用程序打开日历

标签 swift events calendar

如何从 Swift 应用程序打开日历(例如,按下按钮时)?或者有没有办法在应用程序的 View Controller 中嵌入日历? 我想避免使用其他人编写的外部日历。谢谢!

最佳答案

您可以使用 url 方案 calshow:// 打开日历应用程序:

swift 3+

guard let url = URL(string: "calshow://") else { return }
UIApplication.shared.open(url, options: [:], completionHandler: nil)

Swift 2 及以下版本

 UIApplication.sharedApplication().openURL(NSURL(string: "calshow://")!)

使用 EventKit,您可以实现自己的日历。你应该阅读 Calendar and Reminders Programming Guide来自 Apple 网站。

关于swift - 从 Swift 应用程序打开日历,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29684423/

相关文章:

c# - 仅在按下左键时捕获鼠标移动事件

ios - 当通知超过 64 个限制时如何在 iOS 中安排更多本地通知

vue.js - v-model.trim 和 v-model 有什么区别?

ios - 当我点击一个按钮时,如何让我的 iPhone 振动两次?

swift - 嵌套完成处理程序不返回要发送到 TableViewController 的项目

javascript - 对如何使用模块模式的困惑

vue.js - onChange 事件不适用于 `vue-select` npm 包

java - 谷歌日历,如 Swing 应用程序

ios - 使用核心数据将联系人保存到 TableView 中

swift - 从 Any 转换为其他任何对象都失败