如何从 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/