title: CGEvent.tapCreate returns nil even with sandbox disabled
body: <p>I had a C file with a swift bridge that I could call for my macos program and it worked.</p>
  
  <p>But it had a function CGEventTapCreate that only works in terminal by using sudo, otherwise it would return null, and that was the case.</p>
  
  <p>So I ported the C code to Swift, but the function still returns nil because it don't have the privilege. The common solution is to disable sandbox, but the problem persists.</p>
  
  <pre><code>let eventTap : CFMachPort? =
      CGEvent.tapCreate ( tap: CGEventTapLocation.cgSessionEventTap
                        , place: .headInsertEventTap
                        , options: CGEventTapOptions.defaultTap
                        , eventsOfInterest: mask
                        , callback: myCGEventCallback
                        , userInfo: nil )
  
  if eventTap == nil { -- always enter here
      print("[Swift] Failed to create event tap :(")
      exit(1)
  }
  </code></pre>
  
  <p>TL;DR: how to give macOS apps permission to run CGEventTapCreate ?</p>