I have a swift project just like the one the picture I have given. There is a framework on it. The framework is written in objective C(Also some pure c++ code). I successfully imported the framework into swift project and tested some
functionality. Notice, there are also 2 objective c files in the project.(naming linker.h
and linker.m
)
I can call the api in the framework via swift. But the problem is, from objective c none of the api is accessible. I can call nothing from the objective c files(linker.m
). The objective c files cannot even find the framework.
Now why do I need to call from objective c if I can call directly from swift?
Because some of the api are purely written on C++. The associated implementation file is X.mm
. Now according to the documentation of apple I cannot call them directly from swift.
I searched SO and found that I have to create a objective c wrapper for swift. The problem is I cannot call or import the framework in objective c files (linker.m
and linker.h
). How to do that? Any tutorials or materials should I follow?
I hope the question is understandable.