Failed to import bridging header

前端 未结 9 1679
逝去的感伤
逝去的感伤 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 10:01

    This is how I solved it (and works!):

    1. Create yourProjectName-Bridging-Header.h file at the root of your project
    2. Include in that file the .h of the classes you want to expose and use into your swift project
    3. Go to yourProject->Build Settings->Search Paths, and set to Yes the "Always Search User Paths" key.
    4. Set "User Header Search Paths" to your project root path.

    That's it.

    Apparently, Xcode miss out on third party folders when they are copied into your project

    I am on Xcode 6.3 , swift 1.2.

提交回复
热议问题