How do I access a preprocessor macro in Xcode from Swift code for a string I've defined? Other stack overflow posts show how to create the macros, but do not show me how to access them in code sufficiently.
For example, I have defined a constant called HELLO_WORLD_STRING = "Hello World!" in Preprocessor Macros Not Used in Precompiled Headers in the build settings as in the image:
How would I print that constant in the debug window, just as an example?
I actually need to use the value of the app name to set the title of a navigation bar, but I would like to take this route in order to do that.
I have tried using #if ... #endif statements, but the constant was not recognized.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.