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

后端 未结 10 1630
野性不改
野性不改 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:18

    I was stacked this for a quite a while. In my case, my target name is something like "my-app" using dash as a part of target name. I tried to #import "my-app-Swift.h", but Xcode kept giving me errors.

    I dug under 'DerivedData' folder and I found "my_app-Swift.h". So if you are using some interesting characters for the target name. You may try replace those with underscore _.

提交回复
热议问题