Skip to content

Instantly share code, notes, and snippets.

@isaldin
Created April 28, 2015 09:47
Show Gist options
  • Save isaldin/dcb370b090918d66b53b to your computer and use it in GitHub Desktop.
Save isaldin/dcb370b090918d66b53b to your computer and use it in GitHub Desktop.
#pragma mark environment definer start
typedef void(^voidBlock)();
#define IS_TESTING_BUILD NO
#define IS_DEBUG_BUILD NO
#define IS_RELEASE_BUILD NO
/// TESTING_BUILD, DEBUG_BUILD and RELEASE_BUILD setted in Prepocessor macroses (target -> Build Settings)
#ifdef TESTING_BUILD
#undef IS_TESTING_BUILD
#define IS_TESTING_BUILD YES
#endif
#ifdef DEBUG_BUILD
#undef IS_DEBUG_BUILD
#define IS_DEBUG_BUILD YES
#endif
#ifdef RELEASE_BUILD
#undef IS_RELEASE_BUILD
#define IS_RELEASE_BUILD YES
#endif
/// use for test-builds ('xcodebuild test' or Cmd+U)
#define PB_ifTesting(voidBlock) if(IS_TESTING_BUILD) { voidBlock(); }
/// use for debug-builds (Cmd+R)
#define PB_ifDebug(voidBlock) if(IS_DEBUG_BUILD) { voidBlock(); }
/// use for release-builds (adhoc and appstore)
#define PB_ifRelease(voidBlock) if(IS_RELEASE_BUILD) { voidBlock(); }
#pragma mark environment definer end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment