Here's how to get started with ArcGIS Runtime API for iOS:
- Review system requirements
- Install and set up the API
- Get an access token (to access location services)
- 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.
Xcode 13
- Open your Xcode project. In the menu bar, select File > Add Packages...
- In the search bar, enter
https
as the package repository URL.://github.com/esri/arcgis-runtime-ios - Optionally, select an option for the Dependency Rule if you want to specify an exact version or a range of versions to use.
- Click Add Package.
To use the ArcGIS Runtime API, add the following import statement to any of your swift code (.swift) files:
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:
- Add
pod '
to your project's Podfile. This will default to using the latest version available.ArcGI S- Runtime- SD K-i O S' - Optionally, you can specify an exact version or a range of versions to use. Refer to the pod syntax
- 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:
import ArcGIS
The manual download installs the API once for all iOS projects.
- Download the SDK package installer.
- Make sure you have write permissions to the
${
folder.HOM E}/ Library - 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
${
script in the Terminal application.HOM E}/ Library/ Application Support/ AG Si OS Runtime SD K/uninstall AG Si OSSDK - After you've downloaded the SDK, double-click the downloaded .pkg file. Follow the install wizard instructions to complete the installation procedure.
- Complete the additional steps for configure a project.
- By default, the API is installed in
${
. This folder contains the following subfolders: Frameworks, Legal, and Samples.HOM E}/ Library/ SD Ks/ ArcGIS
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 SD
folder from the root /
directory into your user profile's $
directory.
3. Get an access token
To access secure ArcGIS services and resources, you need to use an access token. The easiest way to get started is to obtain an access token from an API Key. Learn more about access tokens and authentication in Security and authentication.
4. Tutorials
Follow step-by-step instructions to build apps that incorporate ArcGIS Runtime functionality.
Deploy your app
When you begin developing ArcGIS Runtime apps, you are accepting Esri's end user license agreement (EULA); there is no need to authorize your development machine or devices. Once you have finished building your application, you are required to obtain a license before deploying it to production. Licensing ensures that you have the necessary permissions and legal rights to distribute and use your application in a commercial or public environment. For more information, see the License and deployment topic for details.