Dispatching callbacks to main thread for Image requests
This commit is contained in:
parent
9a78cc54cd
commit
3512b3b606
1 changed files with 4 additions and 2 deletions
|
|
@ -54,7 +54,9 @@ static dispatch_queue_t image_request_operation_processing_queue() {
|
||||||
dispatch_async(image_request_operation_processing_queue(), ^(void) {
|
dispatch_async(image_request_operation_processing_queue(), ^(void) {
|
||||||
if (error) {
|
if (error) {
|
||||||
if (failure) {
|
if (failure) {
|
||||||
failure(request, response, error);
|
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
||||||
|
failure(request, response, error);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
UIImage *image = nil;
|
UIImage *image = nil;
|
||||||
|
|
@ -69,7 +71,7 @@ static dispatch_queue_t image_request_operation_processing_queue() {
|
||||||
image = imageProcessingBlock(image);
|
image = imageProcessingBlock(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch_sync(dispatch_get_main_queue(), ^(void) {
|
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
||||||
if (success) {
|
if (success) {
|
||||||
success(request, response, image);
|
success(request, response, image);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue