With VisualStudio/Resharper we get a useful feature which hides code (or turns it to another color) based on macro definition. For example:
#ifdef DEBUG
if(!is_DEBUG_defined)
{
// Make code gray
// Or hide it!
}
#endif
Is there any way to have this behaviour in XCode? I noticed that in this case any variable/function defined inside the #ifdef/#endif statements is not available outside in XCode's autocomplete if the macro is not defined but it would be very useful if there was also a visual indication that that code is not actually going to be compiled.
Apparently Xcode already does this - but it's hard to see on some Themes. With the default theme, the source code of non-pre-processed sections is plain black.
Change your theme temporarily to "Dusk" (Xcode->Preferences->Fonts&Colors), and then code of non-pre-processed sections will be in plain white, which is much easier to see.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With