2

After adding a (Core Data) Data Model to an Objective-C iOS app of mine. I get the following error message:

“Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

This is all the more surprising that the app is not Swift but Objective-C.
If anyone has seen this before, how did you handle the problem?

Bhaumik Surani
  • 1,730
  • 3
  • 19
  • 40
Michel
  • 10,303
  • 17
  • 82
  • 179
  • Have you added any entities to your core data model? – Imad Ali May 04 '17 at 08:55
  • Perhaps "Code Generation" is set to "Swift" for the entities? Compare http://stackoverflow.com/questions/38287910/how-can-i-generate-nsmanagedobject-classes-in-swift-instead-of-objective-c-in-xc. – Martin R May 04 '17 at 08:56
  • check if you have added any swift file in your project – Balaji Galave May 04 '17 at 08:56
  • There was no Core Data before and it was working. Then I just added the data model and one entity and I got the problem I described in my post. There is no swift file that I can see or that I consciously created. And using the find command in the terminal I do not find any swift file either. – Michel May 04 '17 at 09:02
  • Did you check the "Code Generation" setting for the new entity? – Martin R May 04 '17 at 09:04
  • No I didn't do anything like that..... In fact I just went to check and it seems it defaults to Swift. Would that be the cause of the issue? – Michel May 04 '17 at 09:05
  • @ Martin R : You spotted the right point. That was it, I changed Swift to Objective-C and it works. Thanks! – Michel May 04 '17 at 09:10

0 Answers0