title: Adding pre-processor macros in Xcode 10
body: <p>I am trying to add pr-processor macros to my Xcode project. This project shares both Swift  and Objective-C code, so I cannot use <code>Swift Compiler -&gt; Other Swift  Flags</code>, because then I cannot read them from objective-c code.</p>
  
  <p>I have the following set in both my app's main target and the project:</p>
  
  <p><a href="https://i.stack.imgur.com/2npRe.png" rel="noreferrer"><img src="https://i.stack.imgur.com/2npRe.png" alt="enter image description here"></a></p>
  
  <p>then, under my app's second target (my Today Extension),  I set IS_MAIN=0.</p>
  
  <p><a href="https://i.stack.imgur.com/PbJE7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/PbJE7.png" alt="enter image description here"></a></p>
  
  <p>However,  when I run this code:</p>
  
  <pre><code>#if IS_MAIN
      print("main: true")
  #else
      print("main: false")
  #endif
  </code></pre>
  
  <p>It never prints the correct one.</p>
  
  <p>How can I add this preprocessor flag so that it is respected by both my Swift and objective-c files? Right now it works in neither type.</p>