Skip to content

Instantly share code, notes, and snippets.

@fictorial
Last active August 29, 2015 13:55
Show Gist options
  • Save fictorial/8702637 to your computer and use it in GitHub Desktop.
Save fictorial/8702637 to your computer and use it in GitHub Desktop.
static inline void dispatchOncePersistent(NSString *prefsKey, void (^aBlock)())
{
if (![[NSUserDefaults standardUserDefaults] boolForKey:prefsKey]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:prefsKey];
[[NSUserDefaults standardUserDefaults] synchronize];
aBlock();
}
}
/*
dispatchOncePersistent(@"show instructions for friend requests", ^{
[SVProgressHUD showSuccessWithStatus:@"Select a friend to send them a friend request"];
});
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment