When you create a new Core Data project in Xcode, the project is set to automatically create subclasses for your Core Data entities when you build the project. When you create a NSManagedObject subclass manually, you now have two copies of the subclass: the one Xcode generates and the one you created. You can have only one copy of the subclass.
To fix the problem either remove the NSManagedObject subclass files you created or tell Xcode not to generate subclasses for your entities. Read the following article for more details:
https://www.swiftdevjournal.com/core-data-code-generation/
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: