Skip to content

Instantly share code, notes, and snippets.

@vinnybad
Created September 12, 2016 02:37
Show Gist options
  • Save vinnybad/ccf23b9c43ee13b3f030d12fdea0dc78 to your computer and use it in GitHub Desktop.
Save vinnybad/ccf23b9c43ee13b3f030d12fdea0dc78 to your computer and use it in GitHub Desktop.
/*
* Strongify / Weakify shortcuts
*
* These declare and instantiate weak and strong variables
* statically so it's easier to write. It's a nice middle-ground
* when compared to other solutions in the wild.
*
*/
#define WEAKIFY(aSelf) __weak typeof(aSelf) weakSelf = aSelf;
#define STRONGIFY(aSelf) __strong typeof(aSelf) strongSelf = aSelf;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment