Skip to content

Instantly share code, notes, and snippets.

@phynet
Last active August 13, 2020 20:35
Show Gist options
  • Save phynet/f00b5ca18aef96c39f2d84cc077965f1 to your computer and use it in GitHub Desktop.
Save phynet/f00b5ca18aef96c39f2d84cc077965f1 to your computer and use it in GitHub Desktop.
implicit import bridging header in module is deprecated

now in swift 4 you just have to import a briding header into Test target and reference objc-class .h files there...using @testable import nameOfYourApp should work

In Swift there's a message in "Test Target" that states that the bridging header will be removed in newer versions of swift. I'm using mixed objc and swift clasess, but the UnitTest class is a swift file. Using @testable key was there in code

  @testable import YourProject

You fix it by adding in your Test area the bridging header with objc headers that your test will use:

  #import "Project-Bridging-Header.h"

Oldated ..

and deleting the @testable inside your test

 import YourProject 
@vegas3416
Copy link

Once I did this..I'm getting a module not found in my original bridging header file now. Warning or error went away in my test class but now my main bridging header is getting screwed up..any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment