There are 2 methods to add the SDK to your project, via CocoaPods (recommended) or by manually adding the library to Xcode.
Preferred method: CocoaPods
Requirements
- Xcode 9 or higher
- iOS 10.0 or higher
- CocoaPods package manager:
Install
$ sudo gem install cocoapods
Get Started
1- pod init
Creates a Podfile for the current directory if none currently exists. If an XCODEPROJ project file is specified or if there is only a single project file in the current directory, targets will be automatically generated based on targets defined in the project.
$ pod init
2- Update Podfile
List the dependencies in Podfile in your Xcode project directory:
target 'MyApp' do pod 'NAOSDK' end
3- pod install
Now you can install the dependencies in your project:
$ pod install
Make sure to always open the Xcode workspace instead of the project file when building your project:
$ open App.xcworkspace
Swift provider
A Swift provider is available since NAO SDK 20.06 release: https://bitbucket.org/polestarusa/naoswiftprovider/src/master
Alternative method: add manually into Xcode
If you do not wish to use CocoaPods, you may install the NAO SDK manually.
- Download the latest iOS NAO SDK.
- Extract/Navigate to the folder <NAO SDK Dir>/Pod/Classes.
- Drag all the SDK’s header files (
.h
) into your Xcode Project Explorer (check the ‘Copy items if needed’ box). - Drag the libNaoSDK.a into your Xcode Project Explorer (check the ‘Copy items if needed’ box).
- Select your root project, then go to ‘Target’, then select ‘Build Phases’ tab. Add the following iOS libraries:
libz.tbd
libc++.tbd
SystemConfiguration.framework
CoreMotion.framework
CoreLocation.framework
CoreBluetooth.framework
CoreData.framework
Your project should now look like this: