mercredi 23 septembre 2015

Adding Swift Unit Tests to a Mixed Language Xcode Project

How do you set up unit tests to test Swift classes added to a previously Objective-c only project?

I've added Swift classes to my project and am able to work with them in other Swift and Objective-c files; however, I'm unable to access them from my test classes.

The import statement I believe is correct is @testable import MyAppModuleName which is what is added to the example test class in Xcode's templates. The error produced by that line is Cannot import module being compiled. This error is in Xcode 7 using Swift 2.

Aucun commentaire:

Enregistrer un commentaire