Skip to content

Commit

Permalink
Refactored methods names
Browse files Browse the repository at this point in the history
  • Loading branch information
belkevich committed Mar 5, 2014
1 parent 915a3c1 commit 0e911c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Classes/APAddressBook.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 6 additions & 5 deletions Classes/APAddressBook.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
});
});
Expand Down

0 comments on commit 0e911c0

Please sign in to comment.