Create a new project

Last updated:

You begin by creating an initial application. Throughout this tutorial, you’ll modify and extend that starter application to create a simple application which cover all the basic features.

Set up your environment

If you haven't already, install CocoaPods: Getting Started with CocoaPods

  • If you don't have an Xcode project yet, create one now and save it to your local machine. (If you're new to iOS development, create a "Single View Application".)
  • Create a file named Podfile in your project directory. This file defines your project's dependencies.
  • Edit the Podfile and add your dependencies. Here is an example:
source 'https://github.com/CocoaPods/Specs.git'
target 'YOUR_APPLICATION_TARGET_NAME_HERE' do
pod 'MapsIndoors', '~>3.19' # Check CocoaPods for latest version
end
  • Save the Podfile.

  • Open a terminal and go to the directory containing the Podfile:

  • cd <path-to-project>

  • Run the pod install command. This will install the APIs specified in the Podfile, along with any dependencies they may have.

  • Close Xcode, and then open (double-click) your project's .xcworkspace file to launch Xcode. From this time onwards, you must use the .xcworkspace file to open the project.

  • Add your credentials to your AppDelegate.swift

    1. Add the following import statements:
    import GoogleMaps
    import MapsIndoors
    1. Add the following to your application(_:didFinishLaunchingWithOptions:) method:
    GMSServices.provideAPIKey(      "YOUR_GOOGLE_API_KEY")
    MapsIndoors.provideAPIKey( "YOUR_MAPSINDOORS_API_KEY",
    googleAPIKey: "YOUR_GOOGLE_API_KEY")

    Replace:

    • YOUR_GOOGLE_API_KEY with your Google API key.
    • YOUR_MAPSINDOORS_API_KEY with your MapsIndoors API key.

Next up: Show a map