Why is code highlighting in Xcode called between #define?

I use #ifdef macroIsFreeVersion #endif to insert code that only applies to the lite version of my application. When I write code between these statements, it seems that code highlighting and syntax warnings are disabled.

Why is this?

I set the macro in the build settings

enter image description here

+4
source share
1 answer

Xcode highlights code based on the result of the #if directive. Any part that is “false” is not highlighted because this code will be compiled. If you switch targets to the light version, you should see backlighting.

This feature makes it easy to see if #if is currently true or not based on the current purpose and the meaning of any “definitions” used inside the #if block.

+3
source

Source: https://habr.com/ru/post/1481420/


All Articles