I want to have a bool macros to enable some functionality in my app per build. For example, enable in QA builds but disable in production. For this, I added this code to my app .xcconfing file:
FEATURE_ENABLED=1
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) FEATURE_ENABLED='${FEATURE_ENABLED}'
OTHER_SWIFT_FLAGS = $(inherited) -DFEATURE_ENABLED='${FEATURE_ENABLED}'
#if FEATURE_ENABLED
// do some stuff
#else
// do some other stuff
#endif
FEATURE_ENABLED is working in ObjC when I change its value, but not working in Swift at all. The question is why, and how to make it work.