Failed to emit precompiled header for bridging header

后端 未结 20 1537
傲寒
傲寒 2020-11-30 04:35

I downloaded a project from GitHub, then pod the following files, some of which are written by OBJ-C and I used a bridge header.

pod ‘SnapKit’
pod ‘MJRefresh         


        
20条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-30 05:06

    Note this can also happen if your bridging header imports Objective-C code that itself imports your app's Swift module via myproject-Swift.h. The solution is to use forward declarations for your Swift types and import the project Swift module in the .m file.

    @class MySwiftClass or...

    typedef NS_ENUM(NSInteger, MySwiftEnumType)

    MySwiftEnumType is the lowest level name even for classes. So Swift enum MyClass.MySwiftEnumType becomes just MySwiftEnumType

提交回复
热议问题