How to add Objective-C Bridging Header entry?

前端 未结 2 1886
星月不相逢
星月不相逢 2021-01-14 09:53

I have a Swift project and have add a cocoapod, which is written in Objective-C. It has header and implementation files. From what I understand, to use/import these files in

相关标签:
2条回答
  • 2021-01-14 10:23

    Are you sure you looked at the correct Build Settings section, search with the keyword Swift compiler - General in the search field as describe below and then you can find it.

    0 讨论(0)
  • 2021-01-14 10:33

    You need to create the header file first. It is a regular Objective-C header file and should be named <Your app or framework name>-Bridging-Header.h. For any Objective-C headers you want Swift to know about add an import statement to the newly created header file. Then follow your previous steps. There is also a hidden header that gets created for you called <Your app or framework name>-Swift.h. If you need to access any Swift classes from an Objective-C file import this header.

    0 讨论(0)
提交回复
热议问题