Created
December 25, 2015 13:54
-
-
Save kjkasi/b4dab427caebcae542c2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This macro for checking block nullability before executing them: | |
#define BLOCK_EXEC(block, ...) if (block) { block(__VA_ARGS__); }; | |
Moves from this: | |
if (completionBlock) | |
{ | |
completionBlock(arg1, arg2); | |
} | |
to: | |
BLOCK_EXEC(completionBlock, arg1, arg2); | |
source |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment