Get started

There are a number of ways to get started to develop with the Maps SDK for Swift. If you are new, follow the steps below to get started with Swift and Xcode.

1. Sign up for an account

To use the ArcGIS Maps SDK for Swift to access content, services, or an organization, you need an ArcGIS Developer account, ArcGIS Online account, or ArcGIS Enterprise account. The type of account, user type, and role you need depends on the resource you need to access and the operations you wish to undertake.

If you do not have an account, select one of the options below:

Get started for free with ArcGIS Platform

Get a free trial for ArcGIS Online



2. Get the SDK and dependencies

Install a supported version of Xcode

  1. Download Xcode and follow installation instructions.

Get the ArcGIS Maps SDK for Swift

  1. Open your Xcode project. In the menu bar, select File > Add Packages…
  2. In the search bar, enter https://github.com/Esri/arcgis-maps-sdk-swift as the package repository URL.
  3. Click Add Package.
  4. Import the API to any of your .swift files using: import ArcGIS.

For more details, go to Install and set up.

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 create an API key. Learn more about access tokens and authentication in Security and authentication.

Get an API key

Implement OAuth 2.0

4. Create your first mapping application

Follow the step-by-step instructions in the display a map tutorial to create your first mapping application. The following code shows how you can create and display a map.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
    // Set your API key during app initialization.
    // ArcGISEnvironment.apiKey = APIKey("<#your-api-key#>")
    // Creates a map with the topographic basemap style.
    @State private var map = Map(basemapStyle: .arcGISTopographic)

    // Creates a map view with the map.
    var body: some View {
        MapView(map: map)
    }

Once you are done building your application, make sure to license it before deploying to production. For more information, see License and deployment topic for details.

5. Follow the tutorials

Go to the tutorials to create and run applications to perform different operations.

6. Explore the samples

Go to the samples to learn how to perform more tasks with the API.

Authenitcate with OAuth

Authenticate with ArcGIS Online (or ArcGIS Enterprise) using OAuth2 to access secured resources.

Display map

Display a map with an imagery basemap.

Add dynamic entity layer

Display data from an ArcGIS stream service using a dynamic entity layer.

Find route

Display directions for a route between two points.

Next steps

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