0

I have an objective c code base and I am writing snapshot test cases in swift. I have certain functions and variable which are declared in .m class. How I can access those variables from swift test class.

Ruby
  • 101
  • 9

1 Answers1

0

Use a bridging header to expose the Objective-C entities that you want to use in your Swift tests. You may already have one set up (as explained in the link, Xcode offers to create one when you add a Swift file to an Objective-C project); if so, you may just need to update the file to add headers that aren't currently included. If you don't have one, the link I provided will show you how to create one.

Caleb
  • 124,013
  • 19
  • 183
  • 272