title: How to unarchive data in swift 3?
body: <p>I have an app where I save an array of <code>CNContact</code> to <code>UserDefaults</code> as such:</p>
  
  <pre><code>var contactsArray = [CNContact]()
  let defaults = UserDefaults()
  func (contact: CNContact){
      contactsArray.append(contact)
      let contactArrayArchive = NSKeyedArchiver.archivedData(withRootObject: contactArray) //archive the data
      defaults.set(contactArrayArchive, forKey: "contactArray")
      defaults.synchronize()
  }
  </code></pre>
  
  <p>This archives the data to allow it to be saved to <code>defaults</code>. My issue is with how I can convert this data back to an array of <code>CNContact</code> in the <code>viewDidLoad</code>. I have seen many answers online which suggest to use <code>NSKeyedArchiver.unarchiveObjectwithData</code> but typing this into Xcode, with swift 3, says that the <code>.unarchiveObjectwithData</code> is not a member of <code>NSKeyedArchiver</code>. I keep looking for stuff about how to do this in swift 3 but have been unsuccessful. How can I unarchive the value?</p>