Skip to content

Instantly share code, notes, and snippets.

@shyambhat
shyambhat / GCDManager.h
Created November 24, 2014 14:42
Clean Objective C helper methods to perform background tasks and perform completion on main thread.
#import <Foundation/Foundation.h>
@interface GCDManager : NSObject
+ (void)performBackgroundTask:(void (^)())block withCompletion:(void (^)())completion;
+ (void)performHighPriorityBackgroundTask:(void (^)())block withCompletion:(void (^)())completion;
+ (void)performLowPriorityBackgroundTask:(void (^)())block withCompletion:(void (^)())completion;
@end