I have seen many articles explaining how to call C functions from Swift, but I would like to explore the converse (if possible), to call Swift functions from C.
I have seen examples illustrating Swift functions in objC, but these do not get me any closer to my goal. Is this task even supported?
The only supported way to call Swift code from C code is to use Objective-C between the two.
That's not to say that it's entirely impossible, but someone would have to come up with a NSInvocation
-like utility and wrappers for objects that don't have an exact C representation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With