Project set up
This guide describes how to set up your iOS project to use the SDK.
To use Maps SDK in your application you need to obtain a TomTom API key by following these instructions. Remember to keep your API key secure.
- 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
- Add a reference to the cocoapods-art repository:
pod repo-art add tomtom-sdk-cocoapods "https://repositories.tomtom.com/artifactory/api/pods/cocoapods"
- 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 'TomTomSDKMapDisplay', 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 for what to do with it: