Xcode not automatically creating bridging header?
There are different way of creating Bridging Header in xcode as mention/suggested above. Here I would give you the best and easiest way of creating Bridge.
- Image1 shows that there is no bridging present at current point of time.
- Image2 show that I have copied a folder containing objective-c header files,after copying a popup will come on screen.
- Image3 is will show the popup message. But after pressing the finish button, you will notice that still there is no bridge present. for reference see image2.
- Now in image5&6 , I just drag and drop the objective-c header file, after doing that you will get popup message.
- After pressing on finish button you get message like Would you like to configure an Objective-C bridging header?. After pressing on Yes Button you get your bridge Header,which you can see in image5.
if you want to keep your header inside one group then use New Group and drag&drop your file in that group.
Never create any folder, or else you will get error due to that.
The reason of your issue is, the Xcode build settings still holds the path to auto generated Bridging Header file. You cannot get any build errors because of the header file (ProjectName-Bridging-Header.h)
still exist in your project directory.
How to resolve:
Click on your project target, Go to Build Settings tab (choose all instead of basic), search for Bridging Header. You can see the Xcode generated path entry. Select it and click on delete button.
Also, make sure to delete the Xcode auto generated bridging header file (ProjectName-Bridging-Header.h)
from your Xcode project directory.
Now, try to import the Obj-C file once again. You can see the prompt to create a bridging header file as expected.
File -> New File -> Header File
Save it as a YourApp-Bridging-Header
Than go to Build Settings, find "Objective-C Bridging Header" (as previously guys told) and pass way to your Bridging Header as: YourApp/YourApp-Bridging-Header.h Where 'YourApp/' is a name of app. It could contain white space, for example 'Your App/'.
In my case in xCode 7.3.1 it works