相关疑难解决方法(0)

以编程方式在iPhone日历中添加自定义事件

有没有办法从自定义应用程序中将iCal事件添加到iPhone日历?

iphone calendar ios eventkit

180
推荐指数
6
解决办法
13万
查看次数

使用EventKit添加事件和日历

我需要向用户日历添加一个事件.

所以我得到他所有的日历:

let calendars = store.calendarsForEntityType(EKEntityTypeEvent)
        as [EKCalendar]
Run Code Online (Sandbox Code Playgroud)

我有一些问题:

  1. 我怎么知道添加事件的日历
  2. 我可以向用户显示他所有的日历并让他选择,但在这个列表中我得到[日历,日历,生日,生日]我得到每个日历两次,那么我该采取什么?
  3. 有没有办法添加新的日历来添加事件?

谢谢

ios eventkit swift

2
推荐指数
1
解决办法
1960
查看次数

EKEventStore 访问请求在 iOS 10 上崩溃。消息:应用程序的 Info.plist 必须包含一个 NSRemindersUsageDescription 键

我的代码:

 EKEventStore* eventStore = [[EKEventStore alloc] init];
 [eventStore requestAccessToEntityType:EKEntityTypeReminder  
            completion:^(BOOL granted, NSError * _Nullable error) {

}];
Run Code Online (Sandbox Code Playgroud)

应用程序的 Info.plist已经包含一个NSRemindersUsageDescription键和NSCalendarsUsageDescription键,但下面的代码在 iOS 8 和 9 上工作正常,但在 iOS 10 上它崩溃了。像:

  [access] This app has crashed because it attempted to access 
   privacy-sensitive data without a usage description.  
   The app's Info.plist must contain an NSCalendarsUsageDescription key 
   with a string value explaining to the user how the app uses this data.
Run Code Online (Sandbox Code Playgroud)

ios ekeventstore

2
推荐指数
1
解决办法
1501
查看次数

标签 统计

ios ×3

eventkit ×2

calendar ×1

ekeventstore ×1

iphone ×1

swift ×1