Skip to content

Instantly share code, notes, and snippets.

@gfx
Created February 28, 2014 11:01
Show Gist options
  • Save gfx/9269202 to your computer and use it in GitHub Desktop.
Save gfx/9269202 to your computer and use it in GitHub Desktop.
// abbrevation: dispatch_once
// description: GCD: dispatch_once
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
$END$
});
// abbrevation: dispatch_after
// description: GCD: dispatch_after
double delayInSeconds = 2.0;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
$END$
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment