问题
I'm trying to get the HueSDK_OSX Framework running using an Object-C-bridging-header.
Here is the framework:
https://github.com/PhilipsHue/PhilipsHueSDK-iOS-OSX/blob/master/Documentation/APIReference_OSX.zip
Bridging-header:
#import <HueSDK_OSX/HueSDK.h>
Swift file:
import PHHueSDK
when typing "import HueSDK_OSX/" the well known code completion list appears with all classes from the framework, but when selecting on of them XCode keeps on saying
Build error: "No such module"
Then, when ommitting the import-directive and calling
let hue = PHHueSDK()
hue.startUpSDK()
Then no build error occurs but instead a linker error
Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_PHHueSDK", referenced from: __TFC8testapp211AppDelegate12awakeFromNibfS0_FT_T_ in AppDelegate.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
回答1:
Additionally to adding the HueSDK_OSX.framework to your project which you apparently did, you also have to add the Lumberjack folder to your project (with the copy option). You will find this folder also in the zip file provided by Philips.
And you need to add the SystemConfiguration.framework to your project for the SCDynamicStoreCopyComputerName function that is called from the HueSDK framework. This helped for me.
回答2:
how about try looking for HomeKit solution? that seems supported philips hue lightings
https://developer.apple.com/library/prerelease/ios/documentation/HomeKit/Reference/HomeKit_Framework/index.html
otherwise you can try to use RESTful API for control light bulbs. http://developers.meethue.com/1_lightsapi.html
回答3:
The Bridging Header you made takes care of it - you do not need to import anything into your Swift classes to use the SDK. Just delete the import from your swift file and it should work (assuming the header is made correctly).
来源:https://stackoverflow.com/questions/24099901/get-phillips-hue-framework-sdk-running-with-swift