title: Read user defaults of another app in Swift
body: <p>In Swift 3+ on macOS 
  I have an app running under the bundle identifier <code>com.bla.bla</code>:</p>
  
  <p>I can read a key with</p>
  
  <pre><code>UserDefaults.standard.string(forKey: "mykey")
  </code></pre>
  
  <p>I can also erase key from other bundle with:</p>
  
  <pre><code>UserDefaults.standard.removePersistentDomain(forName: "com.foo.bar")
  UserDefaults.standard.synchronize()
  </code></pre>
  
  <p>But how can I read a key from another app under the bundle identifer <code>com.foo.bar</code> ?</p>
  
  <p>In command line it is:</p>
  
  <pre><code>defaults read com.foo.bar anotherkey
  </code></pre>
  
  <p>How can I do the same in Swift?</p>