Esri Developer Summit March 8–11, 2016 | Palm Springs, CA

Getting Started with the ArcGIS Runtime SDK for iOS and OS X

Divesh Goyal, Suganya Baskaran • Runtime – what is it?

• Say hello to iOS & OSX SDKs

• Components and Patterns - Display map content Agenda - Search for content - Build a Mac app

• Performance analysis

• Apple resources

ArcGIS Runtime

• Conceptual Model And Common Functionality

• Built Using C++

• Functionality Exposed Via APIs Native To Platform

• Exploits The Capabilities Of The Hardware

• Brings ArcGIS Capabilities To Apps

• Eases Multi Platform Development Device Platforms

PHONE TABLET LAPTOP DESKTOP EMBEDDED Desktop

OS X

Desktop Client

Windows Store QT

.NET Runtime platforms iOS JavaSE

Mobile

Android Embedded Windows Mobile Windows Phone Meet the SDKs ArcGIS Runtime SDK for iOS & OSX

iOS (7.x, 8.x, 9.x) OS X (Mountain Lion, Mavericks, Yosemite, El Capitan) Latest iOS release: Version 10.2.5 Latest OSX release: Version 10.2.4 Adoption Rates iOS 9 OS X - Yosemite IDE Develop iOS & OSX apps Supported Versions: Xcode 6.x, 7.x Storyboard - Layout Options

Apple ID Git & Subversion Integration Integration

Unit tests UI testing Code Coverage

Simulators Instruments Playgrounds Playgrounds Objective – C & Swift

Modern

Concise

Less error prone - Type safe - Optionals

Interoperability Build New Native Apps iOS & OS X SDKs built in Objective C SDK Resources Developers Website

www.developers.arcgis.com SDK Resources Demo Components & Patterns Components of the SDK

- ArcGIS Server, Org, Portals Maps & Layers - Display & Edit Information Location Display Search Geometric Operations

Route - Spatial - Non-spatial Data - Temporal

- Editing - PKI Offline Capabilities - Routing - IWA - Searching Security - Token - OAuth What is a Map?

• Container for layers/webmap • Components - Callout - Magnifier • Responds to Gestures - Touch, TrackPad, Keyboard, Mouse • Displays Device’s Location • Class - AGSMapView Structure of a Map

Basemap – Tiled Layer

- Pre-cached tiles at different scales

- Fetched on demand

- Assembled on screen

- Extremely fast.

- Good for static data.

Sources: ArcGIS Map Services (Cached), OGC WMTS, Bing, OpenStreetMap

SDK Class: Subclasses of ASGTiledLayer Structure of a Map Operational Data

Dynamic Layer - Not cached - Generated & fetched on demand - Customized map images

Sources: ArcGIS Map Services, ArcGIS Image Services, OGC WMS SDK Class: subclasses of AGSDynamicLayer

Feature Layer - Download raw features - Draw natively on screen - Good for editing

Sources: ArcGIS Feature Services SDK Class: AGSFeatureLayer Structure of a Map Sketching Results of Querying, other tasks In Memory Data

Graphics Layer - Array of graphics - Holds geometries - Holds results of tasks Layer pattern

Construct a layer object with URL to the web service

//Construct layer let tiledLayer = AGSTiledMapServiceLayer(URL: serviceUrl)

Add layer to Map View

//Add to map view self.mapView.addMapLayer(tiledLayer, withName:"World Street Map") http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer WebMaps Portal ArcGIS Maps from ArcGIS Org or Portal Org

SDK Class: AGSWebmap

Server Online Content and Services

www.myportalURL.com/arcgis OR http://www.arcgis.com Displaying a Map Demo Searching for Content Searching for Content

ArcGIS Online Portal

Search Portal / Search for Features ArcGIS Online Search for Places/Address Search for Features Query Task

1. Create a Query task

2. Construct Query Parameters Search for Features Query Parameters Attribute Query

Statistics Spatial Query

Temporal Query Order By Related Features Search for Features

My favorite Query Search for Features

My actual Query  Search for Features

Set delegate

Delegation

Adopt protocol Delegation Pattern

Delegate acts on behalf of Delegating Object

1. Task Event Eg. Service Unavailable Or Got Results etc. Query Task 2. User Interaction Query Task 4 Respond To Class Delegate (AnyClass)

3. State3 Change - Set a delegate object - Adopt the protocol - Implement methods of the protocol Search for Features

Execute Method

Delegate Method Handle Results Search Portal

ArcGIS Online Portal

Search Portal / Search for Features ArcGIS Online Search for Places/Address Search Portal

Featured Content Portal ArcGIS User’s Groups Org

Portal Items

Server Online Content Webmap and Services Layer Delegation Search for Places

ArcGIS Online Portal

Search Portal / Search for Features ArcGIS Online Search for Places/Address Search for Places

- Geocode Service - http:///ArcGIS/rest/services/Locators/ESRI_Geocode_USA/GeocodeServer - Geocoding – Address to Locations - Reverse Geocoding – Locations to Addresses - Delegation pattern

SDK Class: AGSLocator Geocoding Demo Performance Analysis Instruments

• Optimize Behavior & Performance

• Trace different aspects - Apps, Processes, Devices, Network

• Troubleshoot

• Use early, use often! Instruments Apple Resources Development & Distribution

Program - Individual - Enterprise - Education • Distribution - Test devices - TestFlight - - Enterprise - Ad-hoc Apple Resources Demo Apple Development Resources

• Apple Developer Site - www.developer.apple.com

• Human Interface Guidelines - Also in iBooks

• Swift iBook

• WWDC videos - www.developer.apple.com/wwdc

• WWDC transcript - http://asciiwwdc.com Apple Distribution Resources

• App Distribution Guide

• App Distribution Quick Start Guide

• iTunes Connect Developer Guide

• App Store Review Guidelines - https://developer.apple.com/app-store/review/guidelines/ • Runtime • Core Components - Maps, Layers, Webmaps • Patterns - Layer - Delegation - MVC • Demo Recap - Show map contents, searching - iOS & OSX • Instruments • Resources - developers.arcgis.com - developer.apple.com Thank you iOS/OSX SDK Sessions

Type Name Day Time

Demo Theatre Securing your iOS Apps in the Field Wednesday 1:00PM to 2:00PM

Building iOS and Mac Apps with the ArcGIS Tech Session Wednesday 2:30PM to 3:30PM Runtime SDK

Tech Session The Road Ahead: ArcGIS Runtime Thursday 5:30PM to 6:30PM

Demo Theatre Test iOS Apps Like a Boss Friday 8:30AM to 9:30AM

and many more Runtime sessions… Feedback