PhilipsHueSDK-iOS-OSX icon indicating copy to clipboard operation
PhilipsHueSDK-iOS-OSX copied to clipboard

Compatible with swift 3?

Open jolaroux opened this issue 8 years ago • 12 comments

Hello, I follow the instructions to integrate the SDK into my existing swift 3 project, and I'm getting an error in the objC header file that says swift can't find the <HueSDK_iOS/HueSDK.h> files, and thats after I imported the framework file and the Lumberjack files. Is this SDK compatible with Swift 3? Is that what this issue means? and if its not, please help me figure out what the problem is. Thanks so much!

jolaroux avatar Sep 23 '16 20:09 jolaroux

I am using the SDK with Swift 3, so it's definitely compatible. Since the library is obj-C the Swift version should be irrelevant. I believe there were only a few instances where XCode updated my code for some optionality issues, but otherwise there was no difference for me in upgrading from Swift 2 to Swift 3 either in code or performance. Have you checked for linking issues?

ibuprofane avatar Sep 23 '16 21:09 ibuprofane

Thanks for giving me hope! Here's my problem. The first error it's giving me is that it can't find the <HueSDK_iOS/HueSDK.h> files, and the error is where I have the import statement in the Header file thats automatically created. and I added the -objC linker in the build settings. Can you think of what the problem is?

jolaroux avatar Sep 23 '16 21:09 jolaroux

This is what I have in my bridging file:

#import <HueSDK_iOS/HueSDK.h> #import "PHBridgeSelectionViewController.h" #import "PHBridgePushLinkViewController.h"

If it's still not finding it, there's probably a reference missing somewhere; could be lots of reasons why, but I'd compare with the QuickStart app and make sure that you add the SDK to the appropriate place(s) in your project settings.

ibuprofane avatar Sep 23 '16 21:09 ibuprofane

Oh hmm all I have in my bridging file is #import <HueSDK_iOS/HueSDK.h> which is what it says to do in the instructions, How did you come to what you have? I'm ready to try anything. And yes i'll look at the quick start app

jolaroux avatar Sep 23 '16 21:09 jolaroux

Huh in that last comment it didn't finish the import statement, its supposed to say <HueSDK_iOS/HueSDK.h'> after the import and i think in your comment it edited out the first one too.

jolaroux avatar Sep 23 '16 21:09 jolaroux

"HueSDK_iOS/HueSDK.h'" is what it edited out of my last 2 comments

jolaroux avatar Sep 23 '16 21:09 jolaroux

Oh, interesting should be

#import <HueSDK_iOS/HueSDK.h>

ibuprofane avatar Sep 23 '16 21:09 ibuprofane

Yeah thats what I have too, But that's all I have in my bridging file, and its saying it can't find the files. And I have already imported the iOSFramework folder, and the lumberjack files. So I don't know what to do but I'm looking :(

jolaroux avatar Sep 23 '16 21:09 jolaroux

http://www.developers.meethue.com/documentation/apple-sdk this is what i'm following, thanks so much for your help by the way

jolaroux avatar Sep 23 '16 21:09 jolaroux

screen shot 2016-09-23 at 5 48 19 pm screen shot 2016-09-23 at 5 49 16 pm

these are the error I'm getting, and the files in my project.

jolaroux avatar Sep 23 '16 22:09 jolaroux

Could you possibly help with this if you can? I fixed on thing, It turned out that I wasn't selecting "Copy items if needed" when i put the SDK files in Xcode, but now I'm getting a different set of issues.

These are the errors I'm getting. http://imgur.com/a/Lc9LV

If you knew anything about how to fix this, that would be amazing!! Thank you so much

jolaroux avatar Sep 24 '16 01:09 jolaroux

Does anyone know the best way to implement selecting which group to affect with lightstate changes in swift 4?

SamwiseChepoackra avatar Mar 20 '18 06:03 SamwiseChepoackra