Get started

Here's how to get started with ArcGIS Runtime API for iOS:

  1. Review system requirements
  2. Install and set up the API
  3. Get an API key (to access services)
  4. Start the Display a map tutorial

1. System requirements

Ensure the correct version of macOS and Xcode are installed and your development environment meets the system requirements.

2. Install and set up

There are a number of ways to install and use the API in your Xcode project. You can use Swift Package Manager, Cocoapods, or the manual download and install process. If you are completing the tutorials, choose the manual download and install process.

The ArcGIS Runtime API for iOS can be easily integrated into your Xcode project using Swift Package Manager.

  1. Open your Xcode project. At to the menu bar, select File -> Swift Packages -> Add Package Dependency.
  2. Enter https://github.com/esri/arcgis-runtime-ios as the package repository URL. Click Next.
  3. Specify a version, or choose the latest version presented by Xcode. Click Next. Xcode will begin downloading the ArcGIS framework to your machine.
  4. Choose the product and target to which you want to add ArcGIS Runtime. Click Finish.

Swift Package Manager

To use the ArcGIS Runtime API, add the following import statement to any of your swift code (.swift) files:

 
1
import ArcGIS

The ArcGIS Runtime API for iOS is available as a registered CocoaPod. If you are new to CocoaPods, review learn how to get started with CocoaPods, and then follow these instructions to use this pod within your iOS project:

  1. Add pod 'ArcGIS-Runtime-SDK-iOS' to your project's Podfile.
  2. Run the command pod install on the Podfile using the Terminal application. This will download the ArcGIS framework to your machine and place it inside your project's Pod directory. It will also make the necessary changes to your project's build settings to correctly reference the ArcGIS framework and create a new Xcode workspace (.xcworkspace file).

To use the ArcGIS Runtime API, open the newly created Xcode workspace and add the following import statement to any of your swift code (.swift) files:

 
1
import ArcGIS

The manual download installs the API once for all iOS projects.

Download iOS package installer
  1. Download the SDK package installer.
  2. Make sure you have write permissions to the ${HOME}/Library folder.
  3. If you have installed a previous version of ArcGIS Runtime API for iOS on this machine, uninstall it. Otherwise, the previous installation will be overwritten. To uninstall, run the ${HOME}/Library/Application Support/AGSiOSRuntimeSDK/uninstallAGSiOSSDK script in the Terminal application.
  4. After you've downloaded the SDK, double-click the downloaded .pkg file. Follow the install wizard instructions to complete the installation procedure.
  5. Complete the additional steps for configure a project.
  6. By default, the API is installed in ${HOME}/Library/SDKs/ArcGIS. This folder contains the following subfolders: Frameworks, Legal, and Samples.

You can go to the Samples folder and run either the Objective-C or Swift sample to ensure that everything was installed correctly on your machine.

If you encounter installation errors, see the install.log file at /var/log/install.log for more information. A common reason for failure is the installation package was corrupted during download. Try downloading the package again. On rare occasions, the installer may ask you for your username/password during installation. When this happens, the installer finishes successfully but the SDK gets installed in the root directory instead of in your home directory. To resolve this issue, you can manually copy the SDKs folder from the root /Library directory into your user profile's $HOME/Library directory.

3. Access services and content with an API key

API keys are permanent tokens that grant your application access to ready-to-use services and, with an ArcGIS Developer account, private content hosted in ArcGIS Platform (currently in beta). Your apps will always require an access token, such as an API key or OAuth 2.0 token, in order to access these resources. Refer to authentication methods in the developer guide for details.

To set an API key in your application, find and copy an API key from your developer dashboard and replace the string YOUR_API_KEY / ACCESS_TOKEN in your code with the API key copied from your dashboard. This key is scoped to provide access to all of the services and resources shown in the tutorials.

  1. Log in to your developer dashboard.
  2. Select and copy your default API key, or generate a new one.
  3. In your code, replace the string YOUR_API_KEY / ACCESS_TOKEN with the API key from your dashboard.

4. Tutorials

Next steps

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.