xcodeswiftmicrosoft-band

Developing for Microsoft Band on iOS


After creating a swift-based iPhone app, I have added the band .framework file into my xcode project. I then created a header file including:

#ifndef BandHeader_h
#define BandHeader_h

#import <MicrosoftBandKit_iOS/MicrosoftBandKit_iOS.h>

#endif /* BandHeader_h */

when I try to initialise MSBClient ViewController.swift, it says use of undeclared type, what am I doing wrong?


Solution

  • The steps in this answer will help: Swift "Bridging-Header.h" file not allowing me to instantiate objective-c classes in .swift files

    In general, you need a bridging header and you must set that in your build steps so it can be found.

    You can also see an example of a bridging header in use for the Microsoft Band Kit here: https://github.com/mthistle/MicrosoftBandKit_iOS-Swift2/tree/master/BandSensor/BSwiftHeartRate