A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/maps/documentation/ios-sdk/utility/setup below:

Setup and Demo | Maps SDK for iOS

Skip to main content Setup and Demo

Stay organized with collections Save and categorize content based on your preferences.

Select platform: Android iOS

This page describes how to set up the utility library for the Maps SDK for iOS.

To try these utilities, you can either:

Add the Maps SDK for iOS Utility Library to an Xcode project

Follow these steps to add the utility library to your Xcode workspace:

Use Swift Package Manager
  1. 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 new project and select the iOS App template. On Xcode 11.7 or older, create a Single View Application.)
  2. Add the Maps SDK for iOS as a dependency. See Installing the SDK for options.
  3. In your Xcode project, navigate to File -> Swift Packages -> Add Package Dependency.
  4. In the presented window, enter the Maps SDK for iOS Utility Library repository URL https://github.com/googlemaps/google-maps-ios-utils and select Next.
  5. In the next window, select the Version radio option, select Up to Next Major Version from the drop-down list, and enter the latest version of the Maps SDK for iOS Utility Library (for example, "6.0.0").
  6. Click the drop-down next to Add to Project, select your project, and select Add Package.
Use CocoaPods
  1. 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.)
  2. If you don't already have a pod file for your project, create a file named Podfile in your project directory. This file defines your project's dependencies.
  3. Edit your project's pod file and add a dependency on the Google-Maps-iOS-Utils pod. Here is an example which includes the dependencies you need for the Maps SDK for iOS and the utility library:
    source 'https://github.com/CocoaPods/Specs.git'
    platform :ios, '16.0'
    
    target 'YOUR_APPLICATION_TARGET_NAME_HERE' do
      use_frameworks!
      pod 'GoogleMaps', '10.0.0'
      pod 'Google-Maps-iOS-Utils', '6.1.2' # x-release-please-version
    end
  4. Run pod install.
  5. 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.

Note: The marker clustering utility is dependent on the quadtree, but you can use the quadtree without marker clustering. If you want only the quadtree utility, you can change pod 'Google-Maps-iOS-Utils' to 'Google-Maps-iOS-Utils/QuadTree' in your pod file.

Add the API key to your app

See

Set up an Xcode Project

for instructions on generating an API key and adding it to your Xcode project.

Build and run the project

After you add the API key, build and run the project.

Use a utility in your app

See the documentation on each utility for more information on using it in your app:

Install and run the demo app

The utility library includes a demo app that you can install and then try out each utility.

Install the demo app:

Use files from GitHub
  1. Download the code sample archive from GitHub and unpack the archive.
  2. Open a terminal window, navigate to the directory where you expanded the sample files, and drill down into the appropriate samples directory for the language you want to use:
  3. Run the following command:
    pod install
  4. 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 the API key to the demo app

In

Get an API key

, you generate an API key for your app. Now add that key to the Xcode project for the demo app.

Note: If your API key uses an Application restriction, ensure that you add the bundle identifier of your app to the key. For example, if you are running the demo app, the bundle identifier is com.google.gmsutils.DemoApp. See Get an API key for more information on restricting a key. Swift

Add your API key to your AppDelegate.swift as follows:

  1. Add the following import statement:
    import GoogleMaps
  2. Edit the following line to add your API key between the double quotes:
    // Change this key to a valid key registered with the demo app bundle id.
    let mapsAPIKey = ""
Objective-C

Add your API key to your AppDelegate.m as follows:

  1. Add the following import statement:
    @import GoogleMaps;
  2. Edit the following line to add your API key between the double quotes:
    // Change this key to a valid key registered with the demo app bundle id.
    static NSString *const kMapsAPIKey = @"";
Build and run the demo app

After you add the API key, build and run the project:

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-23 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-23 UTC."],[[["This documentation guides you on setting up and utilizing the Google Maps SDK for iOS Utility Library, offering tools like marker clustering, quadtrees, and data rendering."],["You can integrate the library into your Xcode project using Swift Package Manager or CocoaPods, then access utilities for enhanced map functionalities."],["A demo app is available for exploring these utilities; you can install it via GitHub or CocoaPods and add your API key for testing."],["Before running the demo app or your own project, ensure you have a valid API key and potentially adjust bundle identifiers for application restrictions."],["Detailed instructions and code examples are provided for both Swift and Objective-C to facilitate seamless integration and usage of the library."]]],["To integrate the Maps SDK for iOS Utility Library, you can add it to an existing Xcode project via Swift Package Manager or CocoaPods. This involves adding the library's repository URL or pod dependency, selecting the desired version, and running the installation. Alternatively, you can install and run a demo app by downloading the code from GitHub, installing the dependencies with `pod install`, and adding your API key. Finally you can build and run the project.\n"]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4