Xojo plugin for macOS in Swift?

Is it possible to create Xojo plugin for macOS in Swift instead of Objective-C?
Or at least integrate the Obj-C boilerplate/skeleton plugin code with Swift code and libraries?

thanks

1 Like

Hi Antonio,

It certainly is possible to use Swift but, as far as I know, you would need some kind of glue code to handle calling Swift methods from C (or ObjC) methods.

I am interested in that topic but I didn’t have enough time to thoroughly study it for the moment. The only facts I know are:

  • Calls to Swift methods are different to C calls or ObjC calls.
  • Xcode can generate ObjC header files from Swift code, so you can call Swift functions from ObjC.
  • As a consequence, you would need to create a C/ObjC method for each Swift method just to call it and pass the parameters.

HTH