kissmetrics / KISSmetrics-iOS-SDK

iOS SDK for KISSmetrics
http://support.kissmetrics.com/doc/apis-integrations-and-importing-data/#29
6 stars 18 forks source link

I can't import the framework in my swift project. #15

Closed garfiaslopez closed 8 years ago

garfiaslopez commented 9 years ago

Hi, I drag the library into my project, is linked to my target project, added the path to "Header Search Paths", Added the "Objective-C Bridging Header" and import " # import KISSmetricsSDK/KISSmetricsAPI.h "

so when i call "import KISSmetricsSDK" In my SWIFT file, appears "NO SUCH MODULE KISSmetricsSDK".

I already tried with COCOAPODS and the same error occurred.

Thanks.

jstheoriginal commented 8 years ago

Looks like this solved it for me.

in your bridging header, add this:

#import <KISSmetrics_iOS_SDK/KISSmetricsAPI.h>

Then when you are setting your key in the AppDelegate.swift file, do this:

At the top, import the SDK with this line: import KISSmetrics_iOS_SDK

And then setup your key in application(_:didFinishLaunchingWithOptions:) with this line: KISSmetricsAPI.sharedAPIWithKey(YOUR_KEY)

Note that I did pull in the latest non-master branch at https://github.com/kissmetrics/KISSmetrics-iOS-SDK/tree/percy/bitcode_compatability build so not sure if this works on the old Master branch that hasn't been updated since Sept 2014...

percyhanna commented 8 years ago

Can you try again with version 2.3.0? This should be fixed now.

jstheoriginal commented 8 years ago

@percyhanna looks like 2.3.0 fixes this issue! Thank you. 👍

percyhanna commented 8 years ago

Thanks @jstheoriginal, glad it fixed it for you.