I\'m looking at starting to use Swift in a framework, which uses libz.dylib
, but it looks like there\'s no way to import it from within Swift. I tried import
You can import system modules as described in this answer: Importing CommonCrypto in a Swift framework
TLDR
ZLib
to your framework directorymodule.map
file with the following contents
module ZLib [system] {
header "/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/zlib.h"
export *
}
You might have to change the path to your zlib header. The example works for XCode 7 Beta and El Capitan.