title: How to retrieve address book contacts with Swift?
body: <p>I don't understand why my code doesn't compile with Swift.</p>
  
  <p>I am trying to convert this Objective-C code:</p>
  
  <pre><code>CFErrorRef error = NULL;
  ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL, &amp;error);
  
    if (addressBook != nil) { 
      NSLog(@"Succesful."); 
  
      NSArray *allContacts = (__bridge_transfer NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook);
  }
  </code></pre>
  
  <p>This is my current rendition in Swift:</p>
  
  <pre><code>var error:CFErrorRef
  var addressBook = ABAddressBookCreateWithOptions(nil, nil);
  
  if (addressBook != nil) {
      println("Succesful.");
  
      var allContacts:CFArrayRef = ABAddressBookCopyArrayOfAllPeople(addressBook);
  }
  </code></pre>
  
  <p>but, Xcode reports:</p>
  
  <blockquote>
    <p>'Unmanaged' is not convertible to 'CFArrayRef'</p>
  </blockquote>
  
  <p>Do you guys have an idea ?</p>