title: Swift: How to get Console User, UID, and GID via SCDynamicStoreCopyConsoleUser?
body: <p>I am able to get the Username, UID and GID from SCDynamicStoreCopyConsoleUser using python:</p>
  
  <pre><code> #!/usr/bin/python
   from SystemConfiguration import SCDynamicStoreCopyConsoleUser
   cfuser = SCDynamicStoreCopyConsoleUser( None, None, None )
   print cfuser[0] # Returns console user, e.g.: myUsername
   print cfuser[1] # Returns console user’s UID, e.g.: 501
   print cfuser[2] # Returns console user’s GID, e.g.: 20
  </code></pre>
  
  <p>How can I get this same return using Swift?</p>
  
  <p>Swift Declaration of SCDynamicStoreCopyConsoleUser</p>
  
  <pre><code> func SCDynamicStoreCopyConsoleUser(_ store: SCDynamicStore!,
                                      _ uid: CMutablePointer&lt;uid_t&gt;,
                                      _ gid: CMutablePointer&lt;gid_t&gt;) -&gt; Unmanaged&lt;CFString&gt;!
  </code></pre>
  
  <p>My Swift Call</p>
  
  <pre><code> var uid: CMutablePointer&lt;uid_t&gt;!
   var gid: CMutablePointer&lt;gid_t&gt;!
  
   var cfuser: NSArray = [SCDynamicStoreCopyConsoleUser(nil,uid,gid)]
  
   // the return has only one element containing the username
  </code></pre>