title: Get user desktop path in Swift 4.0 and Xcode 9.0
body: <p>I am trying to get the path to the desktop of the current user, but I get a path to another location in the library (see code).</p>
  
  <p>The same code in Playgrounds gives the right answer.
  I used the same code in an earlier created project version of Xcode and that gives also the good results.</p>
  
  <p>The tests are done under MacOS High Sierra, Xcode Version 9.0 (9A235) and Swift 4.0.</p>
  
  <p>Here is the code used:</p>
  
  <pre><code>public func userDesktop() -&gt; String {
    let paths = NSSearchPathForDirectoriesInDomains(.desktopDirectory, .userDomainMask, true)
    let userDesktopDirectory = paths[0]
    return userDesktopDirectory
  }
  
  let myPath:String = userDesktop() + "/"
  print(myPath)
  
  let userDesktopDirectory:String = NSHomeDirectory() + "/" + "Desktop/"
  print(userDesktopDirectory)
  
  /* results in Playground */
  /Users/kader/Desktop/
  /Users/kader/Desktop/
  
  /* Results from a project in Xcode 9.0 */
  /Users/kader/Library/Containers/com.kader.testuserpath/Data/Desktop/
  /Users/kader/Library/Containers/com.kader.testuserpath/Data/Desktop/
  </code></pre>
  
  <p>What is wrong about this code or is it a bug?</p>
  
  <p>I am curious whether more people have experienced the same problem.</p>