3
我想设置提醒,并需要访问请求实体类型的方法在Swift 2.0 iOS9中。然而,它给我的错误:如何在Swift 2.0 iOS 9中requestAccessToEntityType方法?
Use of unresolved identifier
@IBAction func setReminder(sender: AnyObject) {
appDelegate = UIApplication.sharedApplication().delegate
as? AppDelegate
if appDelegate!.eventStore == nil {
appDelegate!.eventStore = EKEventStore()
appDelegate!.eventStore!.requestAccessToEntityType(EKEntityTypeReminder, completion: {(granted, error) in //use of unresolved identifier EKEntityTypeReminder
if !granted {
println("Access to store not granted")
println(error.localizedDescription)
} else {
println("Access granted")
}
})
}
if (appDelegate!.eventStore != nil) {
self.createReminder()
}
}
此代码为雨燕,而不是斯威夫特2.有没有人有这种类型的问题?
thsnk,这个作品! –