Swift: How to call a C function loaded from a dylib

前端 未结 2 1761
挽巷
挽巷 2020-12-03 06:23

Is there a way to call a C function loaded from a dylib from Swift?

This is my dylib file:

cppdemofile.cpp

#include \"cppdem         


        
2条回答
  •  不知归路
    2020-12-03 06:48

    In order to use C++ code in Swift, you need to wrap it in C functions or Objective-C classes.

    Also see Call a C++ function from Swift

提交回复
热议问题