From 0e911c0532ed2c369f968d7c06b2e10946fd1d12 Mon Sep 17 00:00:00 2001 From: Alexey Belkevich Date: Wed, 5 Mar 2014 10:02:47 +0200 Subject: [PATCH] Refactored methods names --- Classes/APAddressBook.h | 3 ++- Classes/APAddressBook.m | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Classes/APAddressBook.h b/Classes/APAddressBook.h index 52e2f01..5b6b438 100644 --- a/Classes/APAddressBook.h +++ b/Classes/APAddressBook.h @@ -20,6 +20,7 @@ + (APAddressBookAccess)access; - (void)loadContacts:(void (^)(NSArray *contacts, NSError *error))callbackBlock; -- (void)loadContacts:(dispatch_queue_t)completionQueue completion:(void (^)(NSArray *contacts, NSError *error))callbackBlock; +- (void)loadContactsOnQueue:(dispatch_queue_t)queue + completion:(void (^)(NSArray *contacts, NSError *error))completionBlock; @end diff --git a/Classes/APAddressBook.m b/Classes/APAddressBook.m index 4628e01..f004e92 100644 --- a/Classes/APAddressBook.m +++ b/Classes/APAddressBook.m @@ -64,10 +64,11 @@ + (APAddressBookAccess)access - (void)loadContacts:(void (^)(NSArray *contacts, NSError *error))callbackBlock { - [self loadContacts:dispatch_get_main_queue() completion:callbackBlock]; + [self loadContactsOnQueue:dispatch_get_main_queue() completion:callbackBlock]; } -- (void)loadContacts:(dispatch_queue_t)completionQueue completion:(void (^)(NSArray *contacts, NSError *error))callbackBlock; +- (void)loadContactsOnQueue:(dispatch_queue_t)queue + completion:(void (^)(NSArray *contacts, NSError *error))completionBlock; { APContactField fieldMask = self.fieldsMask; NSArray *descriptors = self.sortDescriptors; @@ -100,11 +101,11 @@ - (void)loadContacts:(dispatch_queue_t)completionQueue completion:(void (^)(NSAr error = (__bridge NSError *)errorRef; } - dispatch_async(completionQueue, ^ + dispatch_async(queue, ^ { - if (callbackBlock) + if (completionBlock) { - callbackBlock(array, error); + completionBlock(array, error); } }); });