Skip to content

A sample app to demonstrate configuration of a Swift app using the ArcGIS Runtime SDK for iOS

Notifications You must be signed in to change notification settings

eito/swift-arcgis-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This sample app demonstrates the configuration of a Swift app using the ArcGIS Runtime SDK for iOS. You can either take this and run with it, or follow the steps below to create your own from scratch.

Prerequisites:

ArcGIS Runtime SDK for iOS v10.2.3

  • Install the SDK and then download and run the script from here. This script will allow the ArcGIS framework to be imported from Swift.

Application Configuration

  • Open Xcode 6 Beta (7 at time of writing) and create a new project ensuring the language is set to Swift.

  • Next we will configure the application to use the ArcGIS framework. Select your application target and then the "Build Settings" pane. We will be adding Other Linker Flags as well as Framework Search Paths to our project configuration. Add all of the following in bold below.

  • At this point we can start to add some code. Open ViewController.swift in your application and add an import ArcGIS at the top of the file after the import UIKit line. This exposes the ArcGIS objects to your ViewController.
  • Once you have imported the framework, move to the viewDidLoad method and add the following code
var mapView = AGSMapView(frame: view.bounds)
mapView.autoresizingMask = .FlexibleWidth | .FlexibleHeight
mapView.addMapLayer(AGSOpenStreetMapLayer())
view.addSubview(mapView)

Your ViewController.swift file should now look like the following:

  • At this point you can Build and Run your application and you should see something like the following depending on which device you have selected

  • Go build a cool mapping app!

About

A sample app to demonstrate configuration of a Swift app using the ArcGIS Runtime SDK for iOS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages