title: How to deal with deprecated function 'unarchiveObject(with:)'?
body: <p>Try to implement KeychainWrapper from here: <a href="https://github.com/jrendel/SwiftKeychainWrapper" rel="nofollow noreferrer">https://github.com/jrendel/SwiftKeychainWrapper</a>
  It is functioning well but in one piece of code I get mistake: "'unarchiveObject(with:)' was deprecated in iOS 12.0: Use +unarchivedObjectOfClass:fromData:error: instead"</p>
  
  <p>I tried to follow the <a href="https://stackoverflow.com/questions/55982244/how-to-nskeyedunarchiver-unarchiveobject">discussion</a> which seems to be similar but wasn't successful.</p>
  
  <p>The piece of code is here:</p>
  
  <pre><code>open func object(forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -&gt; NSCoding? {
      guard let keychainData = data(forKey: key, withAccessibility: accessibility) else {
          return nil
      }
  
      return NSKeyedUnarchiver.unarchiveObject(with: keychainData) as? NSCoding
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/55982244/how-to-nskeyedunarchiver-unarchiveobject">How to NSKeyedUnarchiver.unarchiveObject</a></p>
  
  <p>Here is the updated version:</p>
  
  <pre><code>open func object(forKey key: String, withAccessibility accessibility: KeychainItemAccessibility? = nil) -&gt; NSCoding? {
  guard let keychainData = data(forKey: key, withAccessibility: accessibility) else {
      return nil
  }
  
  let result = try! NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(keychainData) as? NSCoding
  
  return result
  </code></pre>