Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
enzuru opened this issue Jan 9, 2018 · 2 comments
Open

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

enzuru opened this issue Jan 9, 2018 · 2 comments

Comments

@enzuru
Copy link

enzuru commented Jan 9, 2018

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.

@pcantrell
Copy link
Member

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.

@wildthink
Copy link

wildthink commented Mar 18, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants