In this project we will set up a brand new ARKit app in XCode and add the Placenote CocoaPod to the project.
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.
Now, let's install the Placenote CocoaPod to this project, or any project you're starting with.
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.
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 frameworksuse_frameworks!# Pods for MyFirstApppod '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 frameworksuse_frameworks!# Pods for MyFirstApppod 'PlacenoteSDK'endpost_install do |installer|installer.pods_project.targets.each do |target|target.build_configurations.each do |config|config.build_settings['ENABLE_BITCODE'] = 'NO'endendend
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.
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.
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.
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!
If this error persists, post a question on our Support Channel and we'll help you fix it.