Swift bridging does not support Objective C++ files. This means that any headers that consume or expose C++ entites (like std::vector
; std::iostream
) cannot be added to the bridging header.
The POP bridging header contains:
#import "POP.h"
You should really only #import
that file in your own bridging header, rather than trying to #import
all the .h
files.
If you need to consume some of the API that's defined in .mm
files that isn't exposed with an Objective C or plain C header, then you'll have to make your own header file that exposes it (and probably a back-end that implements what you've exposed).
The reason why you can use .mm
files in a library that's being used by Swift is because all swift uses is the interface to those files - i.e. the .h
files, and as long as those files are in plain C or Objective C, then you can make use of the code that is implemented in the .mm
file. The .mm
files are compiled by Objective C++ compiler (clang++
)