Error, bridging header test.h does not exist

Timo Cengiz picture Timo Cengiz · Jun 14, 2016 · Viewed 7.3k times · Source

So I am going crazy, since I keep on getting the error as described in the title and nothing that I worked.

I will show you what I have tried:

enter image description here

enter image description here

enter image description here

What else can I do?

Please help.

Answer

Mandeep Singh picture Mandeep Singh · Jun 28, 2016

Creating Bridging Header File Manually

First of all delete the Bridging header file which Xcode or may be you have created. And Select your project goto > Build Settings > Search the keyword. Swift Compiler - General. Click on Objective-C Bridging Header , delete that path. Now clean your Project.

Now select your project > Click on Window in the navigation bar . Select Projects and delete your derived data from there.

Now create a new file , select the Source and then select the Header File and create your Bridging header file . File name must be your projectname-Bridging-Header.h and then create it

Select your project goto > Build Settings > Search the keyword. Swift Compiler - General. Click on Objective-C Bridging Header and now add the path in this Objective-C Bridging Header like projectname-Bridging-Header.h

Now import your classes into bridging header file and you can compile it your code easily.

Your bridging header file looks like this when you are creating your file manually.