【发布时间】:2014-06-25 14:24:41
【问题描述】:
慢慢进入 Swift,但仍在为完成块而苦苦挣扎。下面的代码在 Swift 中会是什么样子?
[self.eventStore requestAccessToEntityType:type completion:^(BOOL granted, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[self alertViewWithDataClass:((type == EKEntityTypeEvent) ? Calendars : Reminders) status:(granted) ? NSLocalizedString(@"GRANTED", @"") : NSLocalizedString(@"DENIED", @"")];
});
}];
【问题讨论】:
标签: objective-c block swift