Last active
May 22, 2016 14:50
-
-
Save yuxiangq/0741cd8a55832830e252cf12696699ad to your computer and use it in GitHub Desktop.
EventKit介绍
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <EventKit/EventKit.h> | |
... | |
- (void)createEKEventStore { | |
EKAuthorizationStatus status = [EKEventStore authorizationStatusForEntityType:EKEntityTypeEvent];//获取日历状态权限 | |
if(status != EKAuthorizationStatusAuthorized) { | |
//没有获取权限则请求权限 | |
self.es = [[EKEventStore alloc] init]; | |
[self.es requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted | |
,NSError * _Nullable error) { | |
if(granted) { | |
//获取了日历权限 | |
} | |
}]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment