3

Currently working on a game, and i've gotten to the point where i need to implement multiplayer functionality. I'm trying to load in the GameSparks SDK into my project but am unable to properly import the module and i'm not quite sure whats going on.

The SDK is written in Objective C, but my project is in Swift. They say all you need to do is to import the files into your project, so I installed it with cocoapods and copied the source files over into my project, my files look like this:

files

In my bridging header, i have

#ifndef SuperSpace_Bridging_Header_h
#define SuperSpace_Bridging_Header_h

#import <GS.h>
#import <GSAPI.h>

#endif /* SuperSpace_Bridging_Header_h */

and get no errors, everything compiles fine, however I have no access to the GS module that appears to be the core of the GameSparks SDK.

Has anybody had any luck with this SDK in iOS before? Maybe there is something about bridging between Objective-C and Swift that i'm not understanding?

0

1 Answer 1

3

You should set the bridging header to the target -> Build Settings.

  1. Select target
  2. Click on Build Settings
  3. Search for bridging in search panel.
  4. add the Objective-C Bridging header name, in this case it is Header.h (you can use yours.)

Refer the following image for clear picture.

enter image description here

Try and share your results.

Sign up to request clarification or add additional context in comments.

2 Comments

wow, i thought i was just throwing up a hail mary. Thats exactly what fixed it! Thank you. I did exactly what you said, did a clean and build and everything is now available.
your most welcome.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.