How to run debug build with DEBUG defined

I'm able to build, launch, and debug my Swift app on an iPad from XCode, with a scheme that uses the Debug configuration. If I edit the scheme to use the Release configuration, the build is different, as expected, because in the console it then says my app "was compiled with optimization - stepping may behave oddly; variables may not be available." Fine.

What I don't understand is why regardless of which configuration is in use in the scheme, code inside of #if DEBUG blocks is never executed, e.g.
Code Block
#if DEBUG
print("This never gets printed")
#else
print("this always executes instead")
#endif

That's despite the fact that in my project settings, under Apple Clang - Preprocessing/Preprocessor Macros, it shows 1=DEBUG on the Debug line (and not on the Release line, as expected).

Why then does Swift behave as if DEBUG is never defined, regardless of the scheme's configuration? And what do I need to do in order to have debug-only code controlled by
Code Block
#if DEBUG
blocks? Is there a Swift-lang setting I'm missing?

P.S. I know that #if/#else/#endif is an anti-pattern, but even Apple says to use it, e.g. in this presentation from WWDC 2020, at 16:29:
Introducing StoreKit Testing in Xcode

P.P.S #ifdef DEBUG works no better than #if DEBUG
Answered by rgreene62 in 650348022
I found the answer here:

To use the #if DEBUG macro then you have to define the "Swift Compiler - Custom Flags -Other Flags" to contain the value 

Code Block
-D DEBUG

Accepted Answer
I found the answer here:

To use the #if DEBUG macro then you have to define the "Swift Compiler - Custom Flags -Other Flags" to contain the value 

Code Block
-D DEBUG

How to run debug build with DEBUG defined
 
 
Q