Skip to content

Instantly share code, notes, and snippets.

@nishabe
Last active August 12, 2018 18:21
Show Gist options
  • Save nishabe/405e7a52113e23c56247ab76f0a7fcbb to your computer and use it in GitHub Desktop.
Save nishabe/405e7a52113e23c56247ab76f0a7fcbb to your computer and use it in GitHub Desktop.
OBJC: Force code execution only once
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
// Your code here
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment