I've seen examples of Swift code with #if DEBUG / #endif, and have even used it myself.
I know exactly how preprocessor macros work in c, c++ and Objective-C. In those languages, I know I can say:
#ifdef DEBUG
... some code ...
#endif
And I know that if the DEBUG flag is false at build time, the code will not only not run, but it won't even be compiled. This is important to me because the code inside that block contains some sensitive information that must not end up in my compiled code for non-debug builds.
In Swift, I'm really not sure what happens. I know the code doesn't execute, but I'm also told that Swift doesn't have a preprocessor. So, what exactly is going on here?
Specifically, can I hide sensitive information inside an #if DEBUG block in Swift and be assured that it won't get compiled or in any way be present in the executable when the DEBUG flag is false? Or is #if DEBUG evaluated at runtime in Swift?
Thanks,
Frank