I'm finding it very hard to find out how to configure test targets in Xcode 6b4. Can someone point me in the right direction given this scenario.
I have a mostly Swift project. However, there are some 3rd party Objective-C dependencies, which get put into the application's bridging header. I want to write tests for my Swift code. Ideally, in Swift. The problem I have is this....
If I create a Swift test case, then the compiler complains that it can't find the Objective-C headers in the application's bridging header.
If I create an Objective-C test case, then I cannot import the Swift classes which I want to test.
The only thing which I can do is write Objective-C tests cases, which don't touch any Swift. I cannot write "purely Swift code/tests" due to the Objective-C dependencies.
Does anyone have any advice or had success on this. Or is this the current state of things in Beta 4?
Try putting the
#import "xyz-Swift.h"
statements into your precompiled header files. That way you have different import statements for all of your Obj-C headers, depending on the target:MyProject-Prefix.pch (app target):
MyProjectTests-Prefix.pch (test target):