Here I'm attaching a screenshot of created header file
I have created a new header file in xcode and named it as (projectname)-Bridging-Header.h. But I am not able to find the path and make it work. How to find the path of the file?
To create an Objective-C bridging header file, all you need to do is drag some Objective-C code into your Swift project – Xcode should prompt you with the message "Would you like to configure an Objective-C bridging header?" Click "Creating Bridging Header" and you'll see a file called YourProjectName-Bridging-Header.
Its correct to say, Bridging header allows user to use Objective-C classes/files in their swift code in same project. A Swift bridging header allows you to communicate with your old Objective-C classes from your Swift classes. You will need one if you plan to keep portions of your codebase in Objective-C.
Go to Build Settings of your project, find Objective-C Bridging Header row and remove its contents. This works, and in case anyone ends up with a lot of new errors with NSObject after removing this, check to make sure that you have 'import foundation' in your classes that inherit from NSObject.
First go to project build setting,
Then search Swift in in the search box
After that you will find a Objective C Bridging Header option in Swift Compiler Code Generation Area
Add the bridging header path for this Objective C Bridging Header Option
Path should be Given as
Also you can find below the screen shot for the reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With