Set up C++ library dependencies in Swift projects

Cecilia Humlelu
3 min readFeb 27, 2019

is not tricky if we know the tricks.

TL;DR Swift can not read C++ code directly, but if we wrap the C++ library into an Objective-C module using Objective C++, it will do the trick.

Step One: Create an Objective-C project

Xcode ->New->Project->Cocoa touch framework -> Language:Objective-C -> Next. I named my project CppDependencyTutorial.

Step Two: Set up project dependency

--

--