'Swift - Compiler - other swift flags are not visible to objective c files

my objective c code is not called because custom flag defined in settings is not visible here. Why? How can I define the same for objc?

enter image description here

enter image description here



Solution 1:[1]

For Swift it is enough to define Custom Flags as:

-DMYFLAG

for Objective-C you need to define Preprocessor Macros:

MYFLAG=1

enter image description here

Then in both Swift and ObjC files you can use it like:

#if MYFLAG
    //code
#endif

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bartłomiej Semańczyk