-
-
Save albertodebortoli/3181766 to your computer and use it in GitHub Desktop.
Category - Perform Block After Delay
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "NSObject+PWObject.h" | |
@implementation NSObject (PWObject) | |
- (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay { | |
int64_t delta = (int64_t)(1.0e9 * delay); | |
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delta), dispatch_get_main_queue(), block); | |
} | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface NSObject (PWObject) | |
- (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay; | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment