慢慢進入Swift,但仍然在與完成塊拼搏。下面的代碼如何在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", @"")];
});
}];