2

I Just found Chartboost and I'm trying to integrate the SDK right now but for some reason at step 3 in this Tutorial: https://answers.chartboost.com/hc/en-us/articles/205853276-Download-Integrate-the-Chartboost-SDK-for-iOS-Swift I get a error which says: Use of unresolved identifier "Chartboost". I guess theres something wrong with my header file because thats where I declare Chartboost i think(step 2). But maybe its just at the wrong place cause they didn't say where I have to put the code, so I just put it in the AppDelegate.swift because thats the only file I know that has a didFinishLaunchingWithOptions function. So how can I fix this issue?

Header file:

#ifndef Header_h
#define Header_h
#import <UIKit/UIKit.h>
#import <Chartboost/Chartboost.h>
#import <CommonCrypto/CommonDigest.h>
#import <AdSupport/AdSupport.h>

#endif /* Header_h */

AppDelegate:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        // Initialize the Chartboost library
        Chartboost.startWithAppId("AppId", appSignature: "AppSignature", delegate: nil)

    }
Lukas
  • 451
  • 2
  • 13

1 Answers1

0

I had the same problem and here's how i fixed it.

Check that in Build Settings under Swift Compiler - Code Generation you have the Objective-C Bridging Header location set to a correct path (AppName/headername.h)

And also under Build Settings - Packaging, set Defines Module to Yes.

CMD + B, and now you can proceed with step 3 without getting that unresolved identifier issue.

That should fix the unresolved identifier.

Marek S
  • 51
  • 2