Swift bridging header file won't work with use_frameworks

前端 未结 6 2162
春和景丽
春和景丽 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:15

    1. Add a new file to Xcode (File > New > File), then select “Source” and click “Header File“.
    2. Name your file “YourProjectName-Bridging-Header.h”.
    3. Create the file.
    4. Navigate to your project build settings and find the “Swift Compiler – Code Generation” section. You may find it faster to type in “Swift Compiler” into the search box to narrow down the results. Note: If you don’t have a “Swift Compiler – Code Generation” section, this means you probably don’t have any Swift classes added to your project yet. Add a Swift file, then try again.
    5. Next to “Objective-C Bridging Header” you will need to add the name/path of your header file. If your file resides in your project’s root folder simply put the name of the header file there. Examples: “ProjectName/ProjectName-Bridging-Header.h” or simply “ProjectName-Bridging-Header.h”.Or, simply drag and drop bridging header file from finder to this empty field. This will automatically add the path of bridging header file.
    6. Open up your newly created bridging header and import your Objective-C classes using #import statements. Any class listed in this file will be able to be accessed from your swift classes.

提交回复
热议问题