0

I want to include an Objective-C project (https://github.com/soffes/ssziparchive) into my Swift Project so that I can include the SSZipArchive into my project. I need this so I can unzip a file. As included in the instructions on the Github, I included the folder minizip, SSZipArchive.h, and SSZipArchive.m into my project. I have also created a bridging header where I included the following import into my project #import "SSZipArchive.h". However, when I try to type SSZipArchive on Xcode, the autocomplete doesn't occur, leading me to believe that SSZipArchive isn't included properly in my project. Any ideas on how to do so? I have already looked at numerous links on how to include Objective-C projects into Swift and I have found that I simply need to include the corresponding header files for my project to work.

4

1 回答 1

1

我猜你没有正确设置桥接头路径。这是一个非常常见的问题,但很容易解决。转到 Project Settings -> Build Settings -> Search,然后搜索bridg,然后在 Objective-C Bridging Header 下设置桥接头文件的路径(首先仔细检查它在 Finder 中的路径,因为它可能在某个子目录中你的项目)。

还要确保所有包含的头文件都具有应用程序的目标。要检查它们是否有,请单击头文件,从右侧打开实用程序并在目标成员下,确保选中第一个目标。

于 2015-02-22T08:57:42.260 回答