Skip to content

Instantly share code, notes, and snippets.

@tkoki
Created April 8, 2015 08:41
Show Gist options
  • Save tkoki/4bc9ec288d5191696459 to your computer and use it in GitHub Desktop.
Save tkoki/4bc9ec288d5191696459 to your computer and use it in GitHub Desktop.
GCDでの遅延実行パターン
double delayInSeconds = 1.0; // 遅延時間
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
// ここに遅延実行したい処理を記述。
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment