Reputation: 25
I have a CoreData model that is already in use. In that data model, one of the relationships uses a reserved keyword in Swift, "case" in this case. When I use XCode to create subclass of the NSManagedObject
, it gets an error because it tries to declare a @NSManaged var case
, and "case" is a reserved keyword.
If I try to change the relationship name in the CoreData model, the app will not be able to read the previous database without migration. Is there a way to get around this naming issue without doing a database migration or am I stuck with database migration?
Upvotes: 0
Views: 184
Reputation: 139
Back ticks will escape reserved words in swift 2. Not sure if that got trashed in swift 3.
var `case`
edit: this is still available in Swift 3.0
Upvotes: 1