1

I'm facing a problem trying to write a test for class written in Objective-c and gets injected with a class written in Swift.

Example in the Test file:

SomeSwiftClass *swiftVar = [SomeSwiftClass new];
SomeObjectiveCClass *objVar = [[SomeObjectiveCClass alloc] initWithSwiftClass:swiftVar]

But the complier doesn't recognize the Swift class, and it doesnt support importing the "Target-Swift.h" too..

How can I write a test for both Objective c and Swift at the same TestFile ?

MCMatan
  • 8,623
  • 6
  • 46
  • 85

1 Answers1

0

There are quite a few things that need to be in place if you want to use a Swift class in Objective-C.

I managed to get it working, so if you post more of your code or share what you're doing I might be able to help.

Community
  • 1
  • 1
simple_code
  • 707
  • 9
  • 24