This repository contains Swift sample code demonstrating the capabilities of the ArcGIS Maps SDK for Swift and how to use those capabilities in your own app. The project can be opened in Xcode and run on a simulator or a device.
- Maps - Open, create, interact with and save maps
- Scenes - Visualize 3D environments and symbols
- Layers - Display vector and raster data in maps and scenes
- Augmented Reality - View data overlaid on the real world through your device's camera
- Visualization - Show graphics, popups, callouts, sketches, and style maps with symbols and renderers
- Edit and Manage Data - Add, delete, and edit features and attachments, and taking data offline
- Search and Query - Find addresses, places, and points of interest
- Routing and Logistics - Calculate routes between locations and around barriers
- Analysis - Perform spatial analysis via geoprocessing tasks and services
- Cloud and Portal - Search for web maps and securely connect to your portal
- Utility Networks - Work with utility networks, performing traces and exploring network elements
- ArcGIS Maps SDK for Swift 200.4 (or newer)
- ArcGIS Maps SDK for Swift Toolkit 200.4 (or newer)
- Xcode 15.0 (or newer)
The ArcGIS Maps SDK for Swift Samples app has a Target SDK version of 15.0, meaning that it can run on devices with iOS 15.0 or newer.
- Fork and then clone the repository
- Open the
Samples.xcodeproj
project fileThe project has been configured to use the arcgis-maps-sdk-swift-toolkit package, which provides the ArcGISToolkit framework as well as the ArcGIS framework.
- Run the
Samples
app target
To add the Swift packages to your own projects, consult the documentation for the ArcGIS Maps SDK for Swift Toolkit and ArcGIS Maps SDK for Swift.
Important
Acquire the keys from your dashboard. Visit the developer's website to learn more about API keys.
To run this app and access specific, ready-to-use services such as basemap layer, follow the steps to add an API key to a secrets file stored in the project file's directory, $(SRCROOT)/.secrets
.
- Create a hidden secrets file in the project file's directory.
touch .secrets
- Add your API Key to the aforementioned secrets file. Adding an API key allows you to access a set of ready-to-use services, including basemaps.
echo ARCGIS_API_KEY_IOS=your-api-key >> .secrets
Replace 'your-api-key' with your keys.
Please see Configure App Secrets for adding license key and other details.
- Unfamiliar with SwiftUI? Check out Apple's SwiftUI documentation.
- Want to start a new project? Setup your development environment
- New to the API? Explore the documentation: Guide | API Reference
- Got a question? Ask the community on our forum
Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.
Find a bug or want to request a new feature? Please let us know by creating an issue.
Copyright 2022 - 2024 Esri
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
A copy of the license is available in the repository's LICENSE file.