Project set up

VERSION 0.2.3404
PUBLIC PREVIEW

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.

  1. Install Xcode if you don’t already have it.
  2. Create a new project or open an existing one. The application deployment target has to be set to at least 13.0.
  3. Install Cocoapods on your computer.
    sudo gem install cocoapods
  4. Install cocoapods-art tool on your computer.
    sudo gem install cocoapods-art to install cocoapods-art
  5. Add a reference to the cocoapods-art repository:
    pod repo-art add tomtom-sdk-cocoapods "https://repositories.tomtom.com/artifactory/api/pods/cocoapods"
  6. Create a Podfile in the project folder. The pod init command in the project folder can generate a basic podfile.
  7. At the top of the Podfile add the source of the SDK Cocoapods.
    1plugin 'cocoapods-art', :sources => [
    2 'tomtom-sdk-cocoapods'
    3]
  8. Add the module dependencies that you need in your application.
    1TOMTOM_SDK_VERSION = '0.2.3404'
    2
    3target 'YourAppTarget' do
    4 use_frameworks!
    5 pod 'TomTomSDKMapDisplay', TOMTOM_SDK_VERSION
    6 pod 'TomTomSDKRoutePlannerOnline', TOMTOM_SDK_VERSION
    7 pod 'TomTomSDKRoutePlanner', TOMTOM_SDK_VERSION
    8 (...)
    9end
  9. Install the dependencies by executing the following command in the project folder.
    pod install
  10. To update the SDK version, run the command
    pod repo-art update tomtom-sdk-cocoapods
  11. 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: