import swift class in objective-c, -Swift.h file not found

后端 未结 10 1623
野性不改
野性不改 2020-12-02 15:41

I have an iOS project written with Objective-C. I created an Swift class in the project, the bridging header file for accessing objective-c in Swift is generated successfull

10条回答
  •  我在风中等你
    2020-12-02 16:13

    My addition to Daniel Kroms answer:

    • Never add -Swift.h Header to header. Even if it seems to work. Add the Import to .m file only!

    • In case you use in your header swift classes, make a forward declaration with @class swiftclassname before your @interface

    Then you will see your real errors in your code.

提交回复
热议问题