iphone - 想在 iphone 应用程序中添加提醒

标签 iphone ios reminders

我想在我的 iPhone 应用程序中添加提醒功能,我知道我需要使用本地通知但我不想使用它。

那么有什么办法可以满足我的需求吗??

最佳答案

UILocalNotification 是个好东西,但如果您不想使用它,您可以使用 EventKit 来访问设备的提醒。

创建具有提醒类型的 EventStore 对象。

EKEventStore *store = [[EKEventStore alloc] initWithAccessToEntityTypes:EKEntityMaskReminder];

从用户处获取访问权限。

[store requestAccessToEntityType:EKEntityTypeReminder completion:^(BOOL granted, NSError *error) {
    // handle access here }];

使用此功能创建提醒

+ (EKReminder *)reminderWithEventStore:(EKEventStore *)eventStore

Refer documentation for more details .

关于iphone - 想在 iphone 应用程序中添加提醒,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19093896/

相关文章:

ios - 如何在 iOS 10.3.3 上访问 Windows localhost

iphone - CFAutoRelease() 类似 iOS6 上的行为

ios - 如何计算UITextView中文本的高度?

iphone - 在 EKReminder 中设置 startDateComponents 时出现 "Invalid date component"错误

用于短信和电子邮件通知服务的 C# 代码

iphone - iOS 7 iBeacon 需要硬件吗?

ios - UITextView 不是从 iOS 中的第一行开始

ios - 无操作连接选项

ios - 我遇到这样的错误,我想到了 tableView,但我在堆栈跟踪中看到了有关 FBSDK 的信息

iphone - 如何在我的应用程序中实现网络错误警报?