-
-
Save florianbachmann/5781548 to your computer and use it in GitHub Desktop.
This file contains 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
#define $(...) \ | |
({ \ | |
__weak __typeof__(self) weakSelf = self; \ | |
\ | |
^(__VA_ARGS__) { \ | |
__strong __typeof__(weakSelf) self = weakSelf; \ | |
$_body_ | |
#define $_body_(...) \ | |
__VA_ARGS__ \ | |
}; \ | |
}) | |
$(id arg1, unsigned arg2)({ | |
[self doSomething:arg1 withInterestingValue:arg2]; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment