I am trying to add pr-processor macros to my Xcode project. This project shares both Swift and Objective-C code, so I cannot use Swift Compiler -> Other Swift Flags, because then I cannot read them from objective-c code.
I have the following set in both my app's main target and the project:
then, under my app's second target (my Today Extension), I set IS_MAIN=0.
However, when I run this code:
#if IS_MAIN
print("main: true")
#else
print("main: false")
#endif
It never prints the correct one.
How can I add this preprocessor flag so that it is respected by both my Swift and objective-c files? Right now it works in neither type.





