I recently had to add this particular library and file to my project, and after a lot of troubleshooting problems finally worked, let me go through the steps!
Good
1) finder Swiftzlib , , . ( , zlib , Foundation - ). , Swiftzlib , *.xcodeproj *.xcworkspace.
2) .
- include.h
- module.modulemap
3) include.h :
#include<zlib.h>
4) module.modulemap :
module Swiftzlib [system] {
header "include.h"
export *
}
Swiftzlib .
5) Xcode
- 5a) → ,
libz.tbd - 5b) → Swift Compiler - ,
$(PROJECT_DIR)/Swiftzlib - 5c) →
-lz
6) Xcode (, , , )
- 6a) → Swift Compiler - ,
$(PROJECT_DIR)/Swiftzlib
7) Data+Gzip.swfit import Swiftzlib
8) , !