title: How do I fix this Swift code?
body: <p>I am currently working on an app in Xcode 7.1.1. I would like to run the following Swift code:</p>
  
  <pre><code>else if floor(kCFCoreFoundationVersionNumber) &gt; kCFCoreFoundationVersionNumber10_10 {
          let task = NSTask()
          task.launchPath = "/bin/bash"
          task.arguments = ["-c",
              "osascript -e 'display notification "Your operating system is incompatable" with title "Error"'"]
          task.launch()
          }
  </code></pre>
  
  <p>This should run the <code>oascript</code>command if the user is running anything newer than Yosemite. The problem is that I get unresolved identifier and expected separator errors. If I make the Xcode recommended corrections, the command will no longer work. Is there any workaround in Xcode 7?</p>
  
  <p>Edit:
  A similar problem just came up when I tried to say <code>"echo 'echo "$(whoami) ALL=(ALL) ALL-" &gt;&amp;3' | DYLD_PRINT_TO_FILE=/etc/sudoers newgrp; sudo -s"]</code> This time I also get unresolved identifier errors and expected separator errors. Is there a way to fix this? Sorry if these are dumb questions, this is my first app.</p>