Installing the CocoaPod

Instructions on how to add Placenote SDK to your own Xcode project.

In this project we will set up a brand new ARKit app in XCode and add the Placenote CocoaPod to the project.

Step 1: Create a New Xcode Project

If you already have an existing Xcode project, feel free to skip to Step 2.

In this step, we'll create a brand new ARKit app in Xcode.

Open Xcode and choose File > New > Project

In the dialogue box that opens up, choose Augmented Reality app and click 'Next'. This will create a new Xcode project with a basic ARKit app template.

Give your app a Product name, an Organization name and an Organization identifier. Click 'Next' and choose a folder location for your project.

Your project will now open up in Xcode. If you like, you can run this app on your iOS device and do a quick test that your device supports ARKit and that you're able to build to it.

You will see an aircraft in AR in this basic template.

Step 2: Install Placenote CocoaPod

Now, let's install the Placenote CocoaPod to this project, or any project you're starting with.

1. Configure your Pod file

If you aren’t already using CocoaPods, you can install it by entering this into your terminal window. You can learn more about CocoaPods here.

sudo gem install cocoapods

Go to your project folder in the terminal and run this command to create the initial Podfile.

pod init

This will create a file in your folder named "Podfile". Open it in a text editor and add this line within your target’s do statement. Your Podfile should look like this.

target 'MyFirstApp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for MyFirstApp
pod 'PlacenoteSDK'
end

We recommend adding this post_install line to the end of your Podfile. Your final Podfile will look like this.

target 'MyFirstApp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for MyFirstApp
pod 'PlacenoteSDK'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end

2. Install the Pod

Let's first update the CocoaPod repo on your laptop. This will ensure you get the latest version of Placenote. Run this command in a terminal window. This might take a few minutes.

pod repo update

Now, navigate back to your project folder and run the following command.

pod install

Once this step is complete, you will notice that your project now has a .xcworkspace file in addition to your original .xcodeproj file. Open the .xcworkspace file in Xcode.

From now on, we will always need to open the .xcworkspace file to open your project in Xcode. This is because the Placenote CocoaPod is added to your project as a dependency and the workspace contains both, your project, as well as the Placenote CocoaPod.

The project will NOT BUILD if you open the .xcodeproject file.

Step 3: Configure project settings

In your project settings, under the Build Settings tab, set Enable Bitcode = NO

Under the Pods project, Navigate to Pods/PlacenoteSDK/Frameworks/Placenote.framework

In the Inspector panel on the right, ensure that the Target Membership has PlacenoteSDK checked, as shown below.

Step 4: Test including Placenote SDK in your project

Let's test whether we can include PlacenoteSDK in our project and Build it without errors.

Open ViewController.swift and add "include PlacenoteSDK" as the last include statement on the top, as shown below.

Now try to build the project. You don't need to build the project to the device for this test. Simply building by pressing Command + B on Mac, or in the Menu, going to Product > Build will be sufficient.

If the project builds successfully, we're done with this step!

You might see an error like this when you first set up the project and even during the build.

"No such module PlacenoteSDK"

If you see this error, don't worry, it will disappear after the first time you build. See the image below for this error.

If this error persists, post a question on our Support Channel and we'll help you fix it.