title: Core Data & Xcode 11: Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer
body: <p>Just moved to Xcode 11 and getting the following crash at launch:</p>
  <blockquote>
  <p>CoreData: fault: One or more models in this application are using transformable properties with transformer names that are either unset, or set to NSKeyedUnarchiveFromDataTransformerName. Please switch to using &quot;NSSecureUnarchiveFromData&quot; or a subclass of NSSecureUnarchiveFromDataTransformer instead. At some point, Core Data will default to using &quot;NSSecureUnarchiveFromData&quot; when nil is specified, and transformable properties containing classes that do not support NSSecureCoding will become unreadable.</p>
  <p>CoreData: warning: Property 'color' on Entity 'Group' is using nil or an insecure NSValueTransformer.  Please switch to using &quot;NSSecureUnarchiveFromData&quot; or a subclass of NSSecureUnarchiveFromDataTransformer instead.</p>
  </blockquote>
  <p>I'm creating an <code>NSPersistentContainer</code> at launch using the code below:</p>
  <pre><code>private let container: NSPersistentContainer = {
      let container = NSPersistentContainer(name: &quot;MyApp&quot;, managedObjectModel: MyAppModelVersion.current.managedObjectModel())
      let storeDescription = NSPersistentStoreDescription(url: getStoreURLWithUserName())
      storeDescription.shouldMigrateStoreAutomatically = true
      storeDescription.shouldInferMappingModelAutomatically = true
      container.persistentStoreDescriptions = [storeDescription]
      return container
  }()
  </code></pre>
  <p>Error occurs right after this line is executed:</p>
  <pre><code>let container = NSPersistentContainer(name: &quot;MyApp&quot;, managedObjectModel: MyAppModelVersion.current.managedObjectModel())
  </code></pre>
  <p>I also have a property called 'Color<code>in a</code>Group` entity that's transformable:</p>
  <pre><code>@NSManaged public var color: UIColor?
  @NSManaged public var hexColorValue: String?
  </code></pre>
  <p>Below is how set the property:</p>
  <pre><code>public var hexColor: String? {
      get {
          return self.hexColorValue
      }
      set {
          self.hexColorValue = newValue
          if let str = newValue {
              self.color = UIColor(hex: str)
          }
      }
  }
  </code></pre>
  <p>This is what the property looks like in Core Data:</p>
  <p><a href="https://i.stack.imgur.com/ozBsQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ozBsQ.png" alt="enter image description here" /></a></p>
  <p>I am not sure how to recover from this crash.  This was working fine with Xcode 10</p>