title: Getting contact names and phone numbers in Swift
body: <p>I know this has been asked a lot, yet I'm struggling to find a full solution and the few I find are in Objective C</p>
  
  <p>I have managed to get this far</p>
  
  <pre><code>public static func refreshContacts(){
      let status = ABAddressBookGetAuthorizationStatus()
      if status == .Denied || status == .Restricted {
          // user previously denied, to tell them to fix that in settings
          return
      }
  
      // open it
  
      var error: Unmanaged&lt;CFError&gt;?
      let addressBook: ABAddressBook? = ABAddressBookCreateWithOptions(nil, &amp;error)?.takeRetainedValue()
      if addressBook == nil {
          println(error?.takeRetainedValue())
          return
      }
  
      // request permission to use it
  
      ABAddressBookRequestAccessWithCompletion(addressBook) {
          granted, error in
  
          if !granted {
              // warn the user that because they just denied permission, this functionality won't work
              // also let them know that they have to fix this in settings
              return
          }
  
          if let people = ABAddressBookCopyArrayOfAllPeople(addressBook)?.takeRetainedValue() as? NSArray {
              for person in people{
                  var name = //??????
                  var phoneumber = //??????
              }
  
          }
      }
  }
  </code></pre>
  
  <p>If you read the comment, you can see there is one point where I am not too sure what to do
  How can i get the name and phone numbers?</p>