Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/101.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Swift 2.0 iOS 9中请求AccessToEntityType方法?_Ios_Swift_Swift2_Ios9_Eventkit - Fatal编程技术网

如何在Swift 2.0 iOS 9中请求AccessToEntityType方法?

如何在Swift 2.0 iOS 9中请求AccessToEntityType方法?,ios,swift,swift2,ios9,eventkit,Ios,Swift,Swift2,Ios9,Eventkit,我正在尝试设置提醒,需要访问Swift 2.0中针对iOS9的实体类型方法的请求。但是,它给了我一个错误: 未解析标识符的使用 此代码适用于Swift,但不适用于Swift 2。有人有这种问题吗 eEntityType现在是一个enum,它包含两种可以指定的类型 对于eEntityTypeReminder: appDelegate!.eventStore!.requestAccessToEntityType(EKEntityType.Reminder, completion: {(grante

我正在尝试设置提醒,需要访问Swift 2.0中针对iOS9的实体类型方法的请求。但是,它给了我一个错误:

未解析标识符的使用


此代码适用于Swift,但不适用于Swift 2。有人有这种问题吗

eEntityType
现在是一个
enum
,它包含两种可以指定的类型

对于
eEntityTypeReminder

appDelegate!.eventStore!.requestAccessToEntityType(EKEntityType.Reminder, completion: 
{(granted, error) in
    if !granted 
    {
        println("Access to store not granted")
        println(error.localizedDescription)
    }
    else 
    {
        println("Access granted")
    }
})
或者只是:

.Reminder
.Reminder