OpenBluetoothToolbox / SimpleBLE

SimpleBLE - the all-in-one Bluetooth library for MacOS, iOS, Windows, Linux and Android.
https://www.simpleble.org
Other
655 stars 110 forks source link

Objective-C bindings #235

Open volo-droid opened 1 year ago

volo-droid commented 1 year ago

Would you be up for creating Objective-C bindings? Having those it would be a trivial task to use the library with Kotlin Native and Swift. AFAIU the currently available alternative is to use C bindings, losing all the OOP class structure, and maybe something else like state or error info (please correct me if I'm wrong).

More info about interop between Objective-C and C++ https://dev.to/andreicalazans/how-to-interop-between-objective-c-and-c-5dgp

Also FWIW here's an info on integrating Kotlin Native with C++ via Objective-C (from the VMWare Kotlin Multiplatform case study):

Kotlin/Native doesn’t support C++

We were able to find a workaround for the issue based on this premise:

  • Objective-C integrates with C++ using Objective-C++.
  • From an API perspective (and with regard to the header files), it’s not relevant that the implementation is Objective-C++ (that’s an implementation detail).
  • Kotlin/Native supports Objective-C dependencies (and therefore Objective-C++ dependencies, as long as there is no C++ in the header files).
kdewald commented 1 year ago

Hey @volo-droid, thanks for reaching out.

So far this feature is not planned unless sponsored, given the magnitude of the project.