title: NSKeyedArchiver not persisting data Swift 3
body: <p>I have a an app in production I'm trying to convert from Swift 2.2 to Swift 3. I have tried the Swift 3 code in both XCode 8.1 and XCode 8.2.</p>
  
  <p>The following Swift 2 code works perfectly:</p>
  
  <pre><code>func saveItemsToCache() {
      NSKeyedArchiver.archiveRootObject(items, toFile: itemsCachePath)
  }
  
  func loadItemsFromCache() {
      if let cachedItems = NSKeyedUnarchiver.unarchiveObjectWithFile(itemsCachePath) as? [TruckItem] {
          items = cachedItems
      }
  }
  
  var itemsCachePath: String {
      let documentsURL = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0]
      let fileURL = documentsURL.URLByAppendingPathComponent("Trucks.dat")
      return fileURL.path!
  }
  </code></pre>
  
  <p>But the data isn't being persisted when I use the same code converted for Swift 3:</p>
  
  <pre><code>func saveItemsToCache() {
      print("SAVED TRUCKS:", items)
      NSKeyedArchiver.archiveRootObject(items, toFile: itemsCachePath)
  }
  
  func loadItemsFromCache() {
      if let cachedItems = NSKeyedUnarchiver.unarchiveObject(withFile: itemsCachePath) as? [TruckItem] {
          items = cachedItems
          print("LOADED TRUCKS:", items)
      }
  }
  
  var itemsCachePath: String {
      let documentsURL = FileManager().urls(for: .documentDirectory, in: .userDomainMask).first!
      let fileURL = documentsURL.appendingPathComponent("Trucks.dat")
      return fileURL.path
  }
  </code></pre>
  
  <p>Example console output:</p>
  
  <pre><code>SAVED TRUCKS: [&lt;TruckTelematics.TruckItem: 0xc852380&gt;, &lt;TruckTelematics.TruckItem: 0x9b23ba0&gt;]
  
  LOADED TRUCKS: []
  </code></pre>