siesta icon indicating copy to clipboard operation
siesta copied to clipboard

Siesta works with Objective-C++ with the exception of BOSService

Open enzuru opened this issue 8 years ago • 2 comments

Some background: I work for a company that has created an SDK in Swift that is being used by an Objective-C++ videogame.

While I know Objective-C++ is not supported officially (as per the comment here: http://codejaxy.com/q/327866/ios-objective-c-xcode7-siesta-swift-how-to-get-started-using-siesta-with-objective-c) it would appear that our Swift-wrapped Siesta-based SDK works perfectly for the videogame with the exception of importing the BOSService into the mm file.

With so much of Siesta working, addressing this small issue would appear to get us to complete Objective-C++ support. For now, we are simply manually changing the header by commenting this section out to get it to work:

/*
SWIFT_CLASS("_TtC9VersusSDK6SDKAPI")
@interface SDKAPI : BOSService
@end
*/

I'd be more than willing to lend my hand to any solution that needed to be coded. I'm presently doing research on the problem, and would love any feedback that you may have.

enzuru avatar Jan 09 '18 22:01 enzuru

One thought: it looks like your SDKAPI class subclasses Service. Instead of subclassing, try holding an internal Service reference inside SDKAPI and making it a facade for Siesta’s Service API, much as the GithubBrowser example does. Based on what you commented out, that might solve your issue.

I'm afraid I have no other useful feedback: I have not investigated Objective-C++ support for Siesta, have no knowledge of Obj-C++ / Swift interop, and know nothing about this issue in particular. You are pretty much on your own figuring it out! But I would happily accept a pull request if you do find a solution.

pcantrell avatar Jan 09 '18 23:01 pcantrell

Umm.. This is a shot in the dark but if this works in a .m file have you tried adding a level of indirection? Something like...

ObjCSDKAPI.h (with a .m)

@interface ObjCSDKAPI : BOSService
@end

Then use the ObjCSDKAPI in your ObjC++ .h/.mm.

wildthink avatar Mar 18 '18 02:03 wildthink