跟随iOS6 eventKit和新的隐私设置我使用以下代码 - 这在iOS6设备上运行得非常好.
不过,我希望相同的代码也适用于iOS 5.x的设备,我希望不要两次写"相同的代码" - 似乎错了.
任何人都可以协助优雅的解决方案?
EKEventStore *eventStore = [[EKEventStore alloc] init];
[eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
// some code
}];
Run Code Online (Sandbox Code Playgroud)