+ 2

how to call c++ method in swift?

I don't want to implement the whole project. I write business logic in c++ and I use that codes with android NDK. I don't know how to use that c++ code/library in swift.

24th Aug 2016, 8:23 AM
Aung Thuya
Aung Thuya - avatar
1 Antwort
+ 1
You could use objective-c's support of c++. Xcode allow to use Swift and Objective-c code together by creating bridging header file. Check ' Swift and Objective-C in the Same Project' page on Apple official site. You need to create such file and import your c++ code in it using @import "name of your c++ header". After that you could use c++ methods as native for Swift.
1st Sep 2016, 6:08 AM
Aleksandr Budnik
Aleksandr Budnik - avatar