After these 2 files been generated, you should be able to use TestEntity in your project. Try copy the following line of code into your app delegate, your project should compile without any error.

let _ = TestEntity(context: persistentContainer.viewContext)

Class Definition

This configuration is the default Codegen configuration when you create an entity in the data model editor. With this configuration, Xcode will automatically generate the required NSManagedObject subclass as part of the project’s derived data.

To see this in action, open the sample core data project that you created previously and delete both TestEntity+CoreDataClass.swift and TestEntity+CoreDataProperties.swift . You will notice that after both files been deleted, your project no longer able to compile. This is because you are using the Manual/None configuration for Codegen .

Compile error after deleted the NSManagedObject subclass.

Now try change the Codegen configuration to Class Definition, you will notice that your project now able to compile without any error again.

To see the auto generated file, cmd + click on TestEntity , then select “Jump to Definition”.

Select “Jump to Definition” to see auto generated NSManagedObject subclass.

Right click on the opened TestEntity+CoreDataClass.swift and select “Show in Finder”.

Select “Show in Finder” to see the physical files in finder

Now you should be able to see both TestEntity+CoreDataClass.swift and TestEntity+CoreDataProperties.swift (auto generated by Xcode) in the finder window. However notice that both files are not located in your Xcode project, in fact both of them are located in the “Derived Data” folder of Xcode.

You should never edit the auto generated files as they are managed by Xcode, thus they will be overwritten by Xcode every time you build your project.

Category/Extension

This configuration can be describe as in between of Class Definition and Manual/None. Xcode will only automatically generate TestEntity+CoreDataProperties.swift for you and you will have to manage and maintain TestEntity+CoreDataClass.swift yourself.

Change the Codegen configuration of your sample project to Category/Extension, you will notice that in your derived data, Xcode no longer auto generate TestEntity+CoreDataClass.swift for you, and your project is failing to compile again.