title: How to obtain the app ID programmatically in Swift?
body: <p>In a macOS app, I'm using this code to create a directory in Application Support folder.</p>
  
  <pre><code>let directoryURL = appSupportURL.appendingPathComponent("com.myCompany.myApp").appendingPathComponent("Documents")
  </code></pre>
  
  <p>How can the string <strong>com.myCompany.myApp</strong> obtained programmatically in Swift?</p>
  
  <p>I saw this question but I'm not sure how to use it in my macOS Swift app: <a href="https://stackoverflow.com/questions/11726672/access-app-identifier-prefix-programmatically/11841898#11841898">Access App Identifier Prefix programmatically</a></p>