Project set up
This guide describes how to set up your iOS project to use the SDK.
The Navigation SDK for iOS is only available upon request. Contact us to get started.
- Install Xcode if you don’t already have it.
- Create a new project or open an existing one. The application deployment target has to be set to at least 13.0.
- Install Cocoapods on your computer.
sudo gem install cocoapods
- Install cocoapods-art tool on your computer.
sudo gem install cocoapods-art to install cocoapods-art
- Because the repository for Navigation SDK is private, you will need to contact us to get access. Once you have obtained access, go to repositories.tomtom.com and log in with your account. Expand the user menu in the top-right corner, and select "Edit profile" → "Generate an Identity Token". Copy your token and put it, together with your login, in
~/.netrc
. If the file doesn’t exist, create one and add the following entry:1machine repositories.tomtom.com2login <YOUR_LOGIN>3password <YOUR_TOKEN> - Add a reference to the cocoapods-art repository:
pod repo-art add tomtom-sdk-cocoapods "https://repositories.tomtom.com/artifactory/api/pods/cocoapods"
- Then create a
Podfile
in the project folder. Thepod init
command in the project folder can generate a basic podfile. - At the top of the Podfile add the source of the SDK Cocoapods.
1plugin 'cocoapods-art', :sources => [2 'tomtom-sdk-cocoapods'3]
- Add the module dependencies that you need in your application.
1TOMTOM_SDK_VERSION = '0.2.3404'23target 'YourAppTarget' do4 use_frameworks!5 pod 'TomTomSDKNavigation', TOMTOM_SDK_VERSION6 pod 'TomTomSDKRoutePlannerOnline', TOMTOM_SDK_VERSION7 pod 'TomTomSDKRoutePlanner', TOMTOM_SDK_VERSION8 (...)9end
- Install the dependencies by executing the following command in the project folder.
pod install
- To update the SDK version, run the command:
pod repo-art update tomtom-sdk-cocoapods
- Open the project’s
xcworkspace
.
Next steps
Now that you’ve set up your project, here are some suggestions to extend the functionality: