This document explains how to add Rigablue to a new or existing Xcode project.
This document assumes some familiarity with Xcode and that the source for Rigablue has already been obtained from Rigado’s website or Github account.
- Create a new Xcode Project
Open Xcode and create a new ‘Single View Application’ project. In this example, the project will be named RigablueExample.
- Create Rigablue folder in project folder
Using Finder, navigate to the example project folder. Create a new folder in the top level directory called ‘rigablue’.
- Copy Rigablue Source
Copy the Rigablue source folder and Rigablue.xcodeproj to the newly created "rigablue" folder.
- Add Rigablue to Xcode
In Xcode, drag the Rigablue project file to the example project file.
- Set up the build environment
Open the project properties pane by clicking on the example’s project file. Select the ‘Build Phases’ tab. Open the ‘Target Dependencies’ drop down and click the ‘+’ button. In the window that opens, add Rigablue as a target dependency.
Next, open the ‘Link Binary with Libraries’ drop down and click the ‘+’ button. Select ‘libRigablue.a’ and click ‘Add’.
Note: libRigablue.a will show up in red color until the project is built.
Rigablue header files can now be imported with #import “Rigablue/<header file name>.h”
- Import Rigablue.h and Start the Bluetooth Low Energy Interface
Open AppDelegate.m and add #import “Rigablue/Rigablue.h” under #import “AppDelegate.h”
In ‘didFinishLaunchingWithOptions’ add a call to start the BLE interface:
[[RigLeDiscoveryManager shared Instance] startLeInterface];
- Ready to Go
Your project is now set up to use the classes provided in Rigablue.