Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Objective-C Bridging Header" entry in Build Settings does not appear in Xcode 8.3

I need to add some Objective-C files of a library to my project, and I created the MyProject-Bridging-Header.h file myself. But now I'm not able to set its path because in the project's Build Settings I don't find the Objective-C Bridging Header entry.

Is somebody else experiencing the same? How could I solve this?

like image 759
AppsDev Avatar asked May 01 '17 14:05

AppsDev


2 Answers

In Build Setting choose "all" instead of "basic" enter image description here

like image 176
Farnad Tohidkhah Avatar answered Oct 24 '22 21:10

Farnad Tohidkhah


Usually when you had an Objective-C/Swift project and have added new Swift/Objective-C class file Xcode asks whether you want to create Bridging Header or not.

  • If the option to create Bridging Header automatically f.e. has been denied there`s still an option to create it manually.

  • Since you have already created YourProject-Bridging-Header.h header file all you need to set the path to it in your project Build Settings.

  • To set the path to your Bridging Header file you need to navigate to your project Build Setting where look for Swift Compiler – General section like the Hoa mentioned above.
    It is located between "Swift Compiler - Custom Flags" and "Swift Compiler - Search Paths" ones at the same page with all "Swift Compiler" sections.

  • There you can see Objective-C Bridging Header which you can click and set the path to your YourProject-Bridging-Header.h Bridging Header file like YourProjectName/YourProject-Bridging-Header.h.

  • Now you can open up your YourProject-Bridging-Header.h and put Objective-C/Swift classes using the #import statement into it.

Thanks to http://www.learnswiftonline.com/getting-started/adding-swift-bridging-header/
And Objective-C Bridging Header not getting created with Xcode 8

like image 32
Alexander Avatar answered Oct 24 '22 20:10

Alexander