Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Category - Perform Block After Delay

View NSObject+PWObject.c
1 2 3 4 5 6 7 8 9 10
#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
View NSObject+PWObject.c
1 2 3 4 5 6 7
#import <Foundation/Foundation.h>
 
@interface NSObject (PWObject)
 
- (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay;
 
@end
View NSObject+PWObject.c
1 2 3 4 5 6 7 8 9 10
#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
View NSObject+PWObject.c
1 2 3 4 5 6 7
#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
Something went wrong with that request. Please try again.