Skip to content

Commit

Permalink
Merge pull request #2 from Esri/dgoyal_swift1.2
Browse files Browse the repository at this point in the history
changes for swift 1.2
  • Loading branch information
singhgag committed Jun 9, 2015
2 parents a011a9a + 6d7ce65 commit 5810bb9
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 57 deletions.
15 changes: 7 additions & 8 deletions Add Map Tutorial/swift/MyFirstMapApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,29 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {
// Override point for customization after application launch.
func application(application: UIApplication, willFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
return true
}

func applicationWillResignActive(application: UIApplication!) {
func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

func applicationDidEnterBackground(application: UIApplication!) {
func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication!) {
func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(application: UIApplication!) {
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(application: UIApplication!) {
func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

Expand Down
13 changes: 6 additions & 7 deletions Basemap Tutorial/swift/MyFirstMapApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,29 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {
// Override point for customization after application launch.
func application(application: UIApplication, willFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
return true
}

func applicationWillResignActive(application: UIApplication!) {
func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

func applicationDidEnterBackground(application: UIApplication!) {
func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication!) {
func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(application: UIApplication!) {
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(application: UIApplication!) {
func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

Expand Down
13 changes: 6 additions & 7 deletions Cloud Data Tutorial/swift/MyFirstMapApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,29 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {
// Override point for customization after application launch.
func application(application: UIApplication, willFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
return true
}

func applicationWillResignActive(application: UIApplication!) {
func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

func applicationDidEnterBackground(application: UIApplication!) {
func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication!) {
func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(application: UIApplication!) {
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(application: UIApplication!) {
func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

Expand Down
6 changes: 3 additions & 3 deletions Cloud Data Tutorial/swift/MyFirstMapApp/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class ViewController: UIViewController, AGSMapViewLayerDelegate, UIPickerViewDel
func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
let countryName = self.countries[row]

let featureLayer = self.mapView.mapLayerForName("CloudData") as AGSFeatureLayer
let featureLayer = self.mapView.mapLayerForName("CloudData") as! AGSFeatureLayer

if featureLayer.selectionSymbol == nil {
//SYMBOLOGY FOR WHERE CLAUSE SELECTION
Expand Down Expand Up @@ -143,12 +143,12 @@ class ViewController: UIViewController, AGSMapViewLayerDelegate, UIPickerViewDel
func featureLayer(featureLayer: AGSFeatureLayer!, operation op: NSOperation!, didSelectFeaturesWithFeatureSet featureSet: AGSFeatureSet!) {
//ZOOM TO SELECTED DATA
var env:AGSMutableEnvelope!
for selectedFeature in featureSet.features as [AGSGraphic]{
for selectedFeature in featureSet.features as! [AGSGraphic]{
if env != nil {
env.unionWithEnvelope(selectedFeature.geometry.envelope)
}
else {
env = selectedFeature.geometry.envelope.mutableCopy() as AGSMutableEnvelope
env = selectedFeature.geometry.envelope.mutableCopy() as! AGSMutableEnvelope
}
}
self.mapView.zoomToGeometry(env, withPadding: 20, animated: true)
Expand Down
13 changes: 6 additions & 7 deletions Geocoding Tutorial/swift/MyFirstMapApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,29 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {
// Override point for customization after application launch.
func application(application: UIApplication, willFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
return true
}

func applicationWillResignActive(application: UIApplication!) {
func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

func applicationDidEnterBackground(application: UIApplication!) {
func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication!) {
func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(application: UIApplication!) {
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(application: UIApplication!) {
func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

Expand Down
4 changes: 2 additions & 2 deletions Geocoding Tutorial/swift/MyFirstMapApp/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ class ViewController: UIViewController, AGSMapViewLayerDelegate, UISearchBarDele
}

//Add a graphic for each result
for result in results as [AGSLocatorFindResult] {
for result in results as! [AGSLocatorFindResult] {
self.graphicLayer.addGraphic(result.graphic)
}

//Zoom in to the results
let extent = self.graphicLayer.fullEnvelope.mutableCopy() as AGSMutableEnvelope
let extent = self.graphicLayer.fullEnvelope.mutableCopy() as! AGSMutableEnvelope
extent.expandByFactor(1.5)
self.mapView.zoomToEnvelope(extent, animated: true)
}
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@ The ```master``` branch of this repository contains samples configured for the l
[New to Github? Get started here.](http://htmlpreview.github.com/?https://github.com/Esri/esri.github.com/blob/master/help/esri-getting-to-know-github.html)

## Requirements
* XCode 5 (or higher)
* iOS 7 SDK (or higher)
* [ArcGIS Runtime SDK for iOS](https://developers.arcgis.com/en/ios/) (Requires ArcGIS for Developers account; free to sign up)

[ArcGIS Runtime SDK for iOS](https://developers.arcgis.com/en/ios/) (Requires ArcGIS for Developers account; free to sign up)

For Objective-C :
* XCode 5 (or higher)
* iOS 7 SDK (or higher)

For Swift :
* XCode 6.3 (or higher)
* iOS 8 SDK (or higher)


##Additional Resources

Expand Down
13 changes: 6 additions & 7 deletions Routing Tutorial/swift/MyFirstMapApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,29 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {
// Override point for customization after application launch.
func application(application: UIApplication, willFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
return true
}

func applicationWillResignActive(application: UIApplication!) {
func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

func applicationDidEnterBackground(application: UIApplication!) {
func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication!) {
func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(application: UIApplication!) {
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(application: UIApplication!) {
func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment defaultVersion="1808" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand Down Expand Up @@ -59,7 +59,7 @@
<constraint firstAttribute="height" constant="21" id="qbQ-ul-nVc"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
Expand Down Expand Up @@ -88,6 +88,7 @@
</constraints>
</view>
<connections>
<outlet property="directionsLabel" destination="7Tt-Kh-iQs" id="kgV-hq-cMs"/>
<outlet property="mapView" destination="E7P-Pj-g6W" id="dkw-BL-6NP"/>
<outlet property="nextBtn" destination="gTd-z5-TGA" id="1kN-AO-XxW"/>
<outlet property="prevBtn" destination="5EB-hA-TCB" id="Qa9-5k-2pi"/>
Expand Down
Loading

0 comments on commit 5810bb9

Please sign in to comment.