Skip to content

Instantly share code, notes, and snippets.

@paulrehkugler
Last active December 1, 2015 17:25
Show Gist options
  • Save paulrehkugler/11143969 to your computer and use it in GitHub Desktop.
Save paulrehkugler/11143969 to your computer and use it in GitHub Desktop.
Recursive Block
// Follow up to - https://gist.github.com/paulrehkugler/11063725
BOOL baseCaseCondition = NO; // obviously this should be data driven, not hardcoded
typedef void (^RecursiveBlock)(void (^)());
RecursiveBlock aRecursiveBlock;
aRecursiveBlock = ^(RecursiveBlock block){
if ((baseCaseCondition) && block)
{
block(block);
}
};
aRecursiveBlock(aRecursiveBlock);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment