Failed to import bridging header

前端 未结 9 1660
逝去的感伤
逝去的感伤 2020-12-01 09:19

I\'ve read a lot of questions and answers that deal with a similar issue, but I have yet to find a solution. If anyone could shed some light, that would be wonderful.

9条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-01 09:50

    I answered this in another post: Chartboost integration issues with XCode 6.1

    EXPLANATION:

    It seems like some pods and libraries don't bother importing the basic frameworks as they expect your code to already have them. This doesn't work with Swift as the way to import frameworks changed. All you need to do is to add the frameworks needed in your bridging header file.

    ANSWER:

    It depends on what errors the compiler throws. If it complains about NSObject, NSString, etc... you need to add #import in the top of your bridging header file.

    If it complains about UIView, UIButton, etc... you need to add #import in the top of your bridging header file.

提交回复
热议问题