The class name for entity models in the Core Data model has to have the app name prepended to it. So for an entity named User the class name in the model editor has to be MyAppName.User. This works fine until I added a second target to my project.
The new project expects the entity class names to be SecondAppTargetName.User. How do we support two targets using the same core data model? I tried prepending ${PRODUCT_NAME}.User instead, not expecting it to work. And it doesn't work.
Any ideas on how to share one core data model between targets and satisfy the need of Swift projects to have the PRODUCT_NAME prepended to the class in the model editor?
EDIT: It appears from the Apple documentation here that adding the module name as a prefix to the class name in the model entity inspector is the preferred behavior. If so this seems like a gaping hole since it precludes multiple targets using the same data model. I still have found no workaround for this yet. Some posts here on SO have indicated that using @objc(ClassName) in front of the Swift class definition for the managed object will do the trick, but I haven't been able to verify that yet.