1

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.

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.