Reputation: 138251
How do I call Swift code from C or C++? I can only find documentation for the other way around.
If all else fails, I'll wrap my code in an Objective-C class and use it for interop, but I was wondering if there would be another way.
Upvotes: 1
Views: 330
Reputation: 118761
Xcode automatically generates a "<yourmodule>-Swift.h" header, which you can simply import from your Obj-C code (it has to be Obj-C, since Swift classes are exported as Obj-C classes). See Importing Swift into Objective-C.
Upvotes: 2