0

I want to manually create a Obj-C bridging header file for my new Swift project for use with AudioKit. I am stuck. Everything seems to be correct (I even checked whether a space at the end of the file path was the problem and it isn't, and I cleared the project). As a proof I include a screenshot:

enter image description here

What could be wrong?

Christophe
  • 68,716
  • 7
  • 72
  • 138
Kacper Cz
  • 504
  • 3
  • 17
  • "http://stackoverflow.com/questions/24002369/how-to-call-objective-c-code-from-swift" did you check this? I hope here you will get the answer – satheesh Nov 21 '15 at 15:36
  • No, none of these seem to work. – Kacper Cz Nov 21 '15 at 15:51
  • The naming convention is `<#YourProjectName#>-Bridging-Header.h`. The most reliable way is to let Xcode create the bridging header. – vadian Nov 21 '15 at 16:24
  • You need to also make sure that the path is correct in the target build settings. Search for bridging header under build setting and make sure that the path lines up – bolnad Nov 21 '15 at 22:16

1 Answers1

0

The name of the bridging header should be of the format

<target_name>-Bridging-Header.h

So if your target name is AudioMeter. Then the name of the bridging header should be

AudioMeter-Bridging-Header.h

Also make sure the path of the bridging header is specified in Xcode Build Settings under Objective-C Bridging Header option.

Deva
  • 433
  • 3
  • 11
  • Be aware that bridging header paths are cAsE-sensitive in XCode, in case you added "MyProject-Bridging-header.h" instead of "MyProject-Bridging-Header.h". After changing it, you'll need to clear any .pch files (Precompiled Header C) from your project, which reside in `Build/Intermediates.noIndex/PrecompiledHeaders` somewhere. – Petrus Theron Sep 01 '18 at 12:24