Swift bridging header file won't work with use_frameworks

前端 未结 6 2160
春和景丽
春和景丽 2020-12-30 01:51

I\'m trying to use GoogleidentityToolkit library to handle login an things. I enable use_frameworks! on my pod file, but the module GITkit can\'t be found. I\'m trying to fi

6条回答
  •  有刺的猬
    2020-12-30 02:25

    None of the answers above worked for me or weren't precise enough. In Xcode 11.4 (Swift 5.2) this solution worked for me:

    1. Create a new header file in your project's root directory. I'm not sure if the name of the file actually matters, but Apple's auto-generated bridging header files are named "ProjectName-Bridging-Header.h".

    2. Add all the imports you need to the newly created file.

    3. In Project Navigator click on your project's name.

    4. In the topmost bar choose "Build settings", and in the one a bit lower choose All and Combined.

    5. Search for "Swift Compiler" in the upper right corner

    6. Find "Swift Compiler- General" tab, expand it and double-click the right side of "Objective-C Bridging Header".

    7. All you need to do now is just drag the bridging header file you've created into the pop-up window and hit enter. You're all set!

    *Remember that you'll have to update the path to your Bridging Header every time you project's direct path changes

提交回复
热议问题