From 0df0f43e35917b5fcd1bbdff714a51800b1923c7 Mon Sep 17 00:00:00 2001 From: Gagandeep Singh Date: Thu, 11 Feb 2016 21:22:54 -0800 Subject: [PATCH] updated swift samples --- .gitignore | 2 + .../project.pbxproj | 10 +-- .../AsynchronousGPSample-Info.plist | 50 +++++++-------- .../AsynchronousGP.xcodeproj/project.pbxproj | 6 +- .../AsynchronousGP/AsyncGPParameters.swift | 12 ++-- .../AsyncGPSettingsViewController.swift | 5 +- .../swift/AsynchronousGP/Info.plist | 50 +++++++-------- .../swift/AsynchronousGP/ViewController.swift | 24 +++---- .../ClosestFacility.xcodeproj/project.pbxproj | 6 +- .../ClosestFacilityViewController.swift | 13 ++-- .../swift/ClosestFacility/Info.plist | 50 +++++++-------- .../CustomCallout.xcodeproj/project.pbxproj | 6 +- .../CustomCalloutViewController.swift | 17 +++-- .../swift/CustomCallout/Info.plist | 59 ++++++++++-------- .../project.pbxproj | 6 +- .../swift/DownloadTileCache/AppDelegate.swift | 6 +- .../Helpers/BackgroundHelper.swift | 4 +- .../Helpers/MessageHelper.swift | 2 +- .../swift/DownloadTileCache/Info.plist | 50 +++++++-------- .../DownloadTileCache/ViewController.swift | 21 ++++--- .../project.pbxproj | 7 ++- .../LayersListViewController.swift | 6 +- .../Controllers/OptionsViewController.swift | 2 +- .../swift/DynamicSubLayerReorder/Info.plist | 50 +++++++-------- .../project.pbxproj | 6 +- .../Base.lproj/Main.storyboard | 34 ++++++++-- .../FeatureTemplatePickerController.swift | 8 +-- .../swift/FeatureLayerEditing/Info.plist | 50 +++++++-------- .../FeatureLayerEditing/ViewController.swift | 8 +-- .../swift/FindTask.xcodeproj/project.pbxproj | 6 +- .../swift/FindTask/Base.lproj/Main.storyboard | 12 ++-- .../Controllers/ResultsViewController.swift | 2 +- .../AppIcon.appiconset/Contents.json | 5 ++ .../FindTask/Images.xcassets/Contents.json | 6 ++ FindTaskSample/swift/FindTask/Info.plist | 50 +++++++-------- .../GpsSketching.xcodeproj/project.pbxproj | 6 +- .../GpsSketching/Base.lproj/Main.storyboard | 7 ++- .../GpsSketchingViewController.swift | 6 +- .../Controllers/SettingsViewController.swift | 5 +- .../swift/GpsSketching/Info.plist | 50 +++++++-------- .../project.pbxproj | 6 +- .../Base.lproj/Main.storyboard | 10 +-- .../Controllers/LegendViewController.swift | 2 +- .../Controllers/OptionsViewController.swift | 6 +- .../swift/GenerateRenderer/Info.plist | 50 +++++++-------- .../Geocoding.xcodeproj/project.pbxproj | 6 +- .../GeocodingResultsViewController.swift | 2 +- .../swift/Geocoding/Geocoding/Info.plist | 50 +++++++-------- .../project.pbxproj | 6 +- .../swift/GeodesicSketching/Info.plist | 50 +++++++-------- .../GeometrySample.xcodeproj/project.pbxproj | 6 +- .../RelationshipViewController.swift | 2 +- .../Controllers/RootViewController.swift | 6 +- .../UnitSelectorViewController.swift | 2 +- .../swift/GeometrySample/Info.plist | 54 ++++++++-------- .../project.pbxproj | 6 +- .../GeometryServiceViewController.swift | 11 +--- .../swift/GeometryServiceTask/Info.plist | 50 +++++++-------- .../swift/Gps/Gps.xcodeproj/project.pbxproj | 6 +- GpsSample/swift/Gps/Gps/Info.plist | 54 ++++++++-------- GpsSample/swift/Gps/Gps/ViewController.swift | 4 +- .../GraphicsSample.xcodeproj/project.pbxproj | 6 +- .../FeatureDetailsViewController.swift | 2 +- .../swift/GraphicsSample/Info.plist | 50 +++++++-------- .../IdentifyTask.xcodeproj/project.pbxproj | 6 +- .../IdentifyTask/Base.lproj/Main.storyboard | 7 ++- .../Controllers/ResultsViewController.swift | 2 +- .../swift/IdentifyTask/Info.plist | 50 +++++++-------- .../LegendSample.xcodeproj/project.pbxproj | 6 +- .../DataSource/LegendDataSource.swift | 2 +- LegendSample/swift/LegendSample/Info.plist | 50 +++++++-------- .../LegendSample/Segue/CustomSegue.swift | 2 +- .../project.pbxproj | 6 +- .../LicenseByOrgAccount/AppDelegate.swift | 13 ++-- .../Helper/LicenseHelper.swift | 2 +- .../swift/LicenseByOrgAccount/Info.plist | 50 +++++++-------- .../LocalTiledLayer.xcodeproj/project.pbxproj | 6 +- .../LocalTiledLayerViewController.swift | 4 +- .../Controllers/RootTableViewController.swift | 27 ++++---- .../swift/LocalTiledLayer/Info.plist | 50 +++++++-------- .../MessageMil2525c.xcodeproj/project.pbxproj | 6 +- .../MessageMil2525cViewController.swift | 5 +- .../swift/MessageMil2525c/Info.plist | 50 +++++++-------- .../OAuthLogin.xcodeproj/project.pbxproj | 6 +- .../Controllers/ProfileViewController.swift | 4 +- .../Controllers/SignInViewController.swift | 4 +- .../swift/OAuthLogin/Info.plist | 50 +++++++-------- .../project.pbxproj | 6 +- .../OfflineFeatureEditing/AppDelegate.swift | 10 +-- .../BackgroundHelper.swift | 4 +- .../Base.lproj/Main.storyboard | 9 +-- .../FeatureTemplatePickerViewController.swift | 14 ++--- .../swift/OfflineFeatureEditing/Info.plist | 50 +++++++-------- .../ViewController.swift | 27 ++++---- .../project.pbxproj | 6 +- .../Base.lproj/Main.storyboard | 5 +- .../AppIcon.appiconset/Contents.json | 5 ++ .../BluePushpin.imageset/BluePushpin.png | Bin 0 -> 1226 bytes .../BluePushpin.imageset/Contents.json | 21 +++++++ .../Images.xcassets/Contents.json | 6 ++ .../swift/OfflineGeocoding/Info.plist | 50 +++++++-------- .../RecentViewController.swift | 6 +- .../ResultsViewController.swift | 12 ++-- .../OfflineGeocoding/ViewController.swift | 15 +++-- .../OfflineRouting.xcodeproj/project.pbxproj | 7 ++- .../swift/OfflineRouting/Info.plist | 50 +++++++-------- .../swift/OfflineRouting/ViewController.swift | 42 ++++++------- .../swift/Popup.xcodeproj/project.pbxproj | 6 +- PopupSample/swift/Popup/Info.plist | 50 +++++++-------- PopupSample/swift/Popup/ViewController.swift | 6 +- .../swift/QueryTask.xcodeproj/project.pbxproj | 6 +- .../Controllers/DetailsViewController.swift | 4 +- .../Controllers/RootViewController.swift | 4 +- QueryTaskSample/swift/QueryTask/Info.plist | 50 +++++++-------- .../project.pbxproj | 6 +- .../Controllers/NotesViewController.swift | 12 ++-- .../swift/RelatedRecordEditing/Info.plist | 50 +++++++-------- .../Routing/Routing.xcodeproj/project.pbxproj | 7 ++- .../swift/Routing/Routing/Info.plist | 50 +++++++-------- .../Routing/Routing/ViewController.swift | 16 ++--- .../ServiceArea.xcodeproj/project.pbxproj | 6 +- .../ServiceAreaViewController.swift | 6 +- .../swift/ServiceArea/Info.plist | 50 +++++++-------- .../SketchLayer.xcodeproj/project.pbxproj | 7 ++- .../swift/SketchLayer/Info.plist | 50 +++++++-------- .../SwitchBasemap.xcodeproj/project.pbxproj | 6 +- .../BasemapsGridViewController.swift | 8 +-- .../BasemapsListViewController.swift | 8 +-- .../SwitchBasemapViewController.swift | 4 +- .../Helper/PortalBasemapHelper.swift | 12 ++-- .../swift/SwitchBasemap/Info.plist | 50 +++++++-------- .../Storyboard/Switch Basemap.storyboard | 15 ++--- .../SynchronousGP.xcodeproj/project.pbxproj | 6 +- .../SynchronousGPViewController.swift | 1 - .../swift/SynchronousGP/Info.plist | 50 +++++++-------- .../TableOfContents.xcodeproj/project.pbxproj | 6 +- .../swift/TableOfContents/Info.plist | 50 +++++++-------- .../TOC/Controllers/TOCViewController.swift | 18 +++--- .../AGSMapContentsLayerInfoExt.swift | 4 +- .../AGSMapContentsLegendElementExt.swift | 2 +- .../TemporalSample.xcodeproj/project.pbxproj | 6 +- .../Controllers/TemporalViewController.swift | 8 +-- .../swift/TemporalSample/Info.plist | 50 +++++++-------- .../WeatherInfo.xcodeproj/project.pbxproj | 6 +- .../swift/WeatherInfo/Info.plist | 59 ++++++++++-------- .../swift/Webmap.xcodeproj/project.pbxproj | 6 +- WebmapSample/swift/Webmap/Info.plist | 50 +++++++-------- .../swift/Webmap/ViewController.swift | 4 +- 148 files changed, 1487 insertions(+), 1253 deletions(-) create mode 100644 FindTaskSample/swift/FindTask/Images.xcassets/Contents.json create mode 100644 OfflineGeocodingSample/swift/OfflineGeocoding/Images.xcassets/BluePushpin.imageset/BluePushpin.png create mode 100644 OfflineGeocodingSample/swift/OfflineGeocoding/Images.xcassets/BluePushpin.imageset/Contents.json create mode 100644 OfflineGeocodingSample/swift/OfflineGeocoding/Images.xcassets/Contents.json diff --git a/.gitignore b/.gitignore index 7430109c9..52e9cb2e1 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ DerivedData *.xccheckout *.xcworkspacedata +All Samples.xcworkspace/xcshareddata/All Samples.xcscmblueprint +arcgis-ios-sdk-samples.xcodeproj/project.xcworkspace/xcshareddata/arcgis-ios-sdk-samples.xcscmblueprint diff --git a/AsynchronousGPSample/objective-c/AsynchronousGPSample.xcodeproj/project.pbxproj b/AsynchronousGPSample/objective-c/AsynchronousGPSample.xcodeproj/project.pbxproj index 485fb127c..c6faa424e 100755 --- a/AsynchronousGPSample/objective-c/AsynchronousGPSample.xcodeproj/project.pbxproj +++ b/AsynchronousGPSample/objective-c/AsynchronousGPSample.xcodeproj/project.pbxproj @@ -158,7 +158,7 @@ C57F6DFE13F5A74000DAE553 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0430; + LastUpgradeCheck = 0720; }; buildConfigurationList = C57F6E0113F5A74000DAE553 /* Build configuration list for PBXProject "AsynchronousGPSample" */; compatibilityVersion = "Xcode 3.2"; @@ -224,9 +224,9 @@ C57F6E3213F5A74000DAE553 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(HOME)/Library/SDKs/ArcGIS/iOS/**"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; @@ -238,6 +238,7 @@ HEADER_SEARCH_PATHS = ""; IPHONEOS_DEPLOYMENT_TARGET = 6.0; LIBRARY_SEARCH_PATHS = ""; + ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "-ObjC", "-framework", @@ -255,7 +256,6 @@ C57F6E3313F5A74000DAE553 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Sreejith Parthasarathy (N3WX842HCK)"; FRAMEWORK_SEARCH_PATHS = "$(HOME)/Library/SDKs/ArcGIS/iOS/**"; @@ -285,7 +285,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CLANG_ENABLE_MODULES = YES; @@ -307,6 +306,7 @@ "-l", "c++", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.esri.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -318,7 +318,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CLANG_ENABLE_MODULES = YES; @@ -340,6 +339,7 @@ "-l", "c++", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.esri.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; SDKROOT = iphoneos; diff --git a/AsynchronousGPSample/objective-c/AsynchronousGPSample/AsynchronousGPSample-Info.plist b/AsynchronousGPSample/objective-c/AsynchronousGPSample/AsynchronousGPSample-Info.plist index 5298da1c6..fcb42ff96 100755 --- a/AsynchronousGPSample/objective-c/AsynchronousGPSample/AsynchronousGPSample-Info.plist +++ b/AsynchronousGPSample/objective-c/AsynchronousGPSample/AsynchronousGPSample-Info.plist @@ -9,7 +9,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.esri.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -24,6 +24,30 @@ 1.0 LSRequiresIPhoneOS + NSAppTransportSecurity + + NSExceptionDomains + + arcgis.com + + NSIncludesSubdomains + + NSThirdPartyExceptionAllowsInsecureHTTPLoads + + NSThirdPartyExceptionRequiresForwardSecrecy + + + arcgisonline.com + + NSIncludesSubdomains + + NSThirdPartyExceptionAllowsInsecureHTTPLoads + + NSThirdPartyExceptionRequiresForwardSecrecy + + + + UIMainStoryboardFile Main_iPhone UIMainStoryboardFile~ipad @@ -34,29 +58,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - NSAppTransportSecurity - - NSExceptionDomains - - arcgisonline.com - - NSIncludesSubdomains - - NSThirdPartyExceptionAllowsInsecureHTTPLoads - - NSThirdPartyExceptionRequiresForwardSecrecy - - - arcgis.com - - NSIncludesSubdomains - - NSThirdPartyExceptionAllowsInsecureHTTPLoads - - NSThirdPartyExceptionRequiresForwardSecrecy - - - - diff --git a/AsynchronousGPSample/swift/AsynchronousGP.xcodeproj/project.pbxproj b/AsynchronousGPSample/swift/AsynchronousGP.xcodeproj/project.pbxproj index 35e5e960c..2e15ac120 100644 --- a/AsynchronousGPSample/swift/AsynchronousGP.xcodeproj/project.pbxproj +++ b/AsynchronousGPSample/swift/AsynchronousGP.xcodeproj/project.pbxproj @@ -127,7 +127,8 @@ 97F6691A19E344E7001D1724 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0600; + LastSwiftUpdateCheck = 0720; + LastUpgradeCheck = 0720; ORGANIZATIONNAME = Esri; TargetAttributes = { 97F6692119E344E7001D1724 = { @@ -223,6 +224,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -296,6 +298,7 @@ "-l", "c++", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.esri.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "AsynchronousGP/SVProgressHUD/SVProgressHUD-bridging-header.h"; }; @@ -315,6 +318,7 @@ "-l", "c++", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.esri.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "AsynchronousGP/SVProgressHUD/SVProgressHUD-bridging-header.h"; }; diff --git a/AsynchronousGPSample/swift/AsynchronousGP/AsyncGPParameters.swift b/AsynchronousGPSample/swift/AsynchronousGP/AsyncGPParameters.swift index 94453638c..65732fd95 100644 --- a/AsynchronousGPSample/swift/AsynchronousGP/AsyncGPParameters.swift +++ b/AsynchronousGPSample/swift/AsynchronousGP/AsyncGPParameters.swift @@ -28,13 +28,13 @@ class AsyncGPParameters { func parametersArray() -> [AGSGPParameterValue] { //create parameters - var paramLoc = AGSGPParameterValue(name: "Incident_Point", type: .FeatureRecordSetLayer, value: self.featureSet!) - var paramDegree = AGSGPParameterValue(name: "Wind_Bearing__direction_blowing_to__0_-_360_", type: .Double, value: self.windDirection.doubleValue) - var paramMaterial = AGSGPParameterValue(name: "Material_Type", type: .String, value: self.materialType) - var paramTime = AGSGPParameterValue(name: "Day_or_Night_incident", type: .String, value: self.dayOrNightIncident) - var paramType = AGSGPParameterValue(name: "Large_or_Small_spill", type: .String, value: self.largeOrSmallSpill) + let paramLoc = AGSGPParameterValue(name: "Incident_Point", type: .FeatureRecordSetLayer, value: self.featureSet!) + let paramDegree = AGSGPParameterValue(name: "Wind_Bearing__direction_blowing_to__0_-_360_", type: .Double, value: self.windDirection.doubleValue) + let paramMaterial = AGSGPParameterValue(name: "Material_Type", type: .String, value: self.materialType) + let paramTime = AGSGPParameterValue(name: "Day_or_Night_incident", type: .String, value: self.dayOrNightIncident) + let paramType = AGSGPParameterValue(name: "Large_or_Small_spill", type: .String, value: self.largeOrSmallSpill) - var params:[AGSGPParameterValue] = [paramLoc, paramDegree, paramTime, paramType, paramMaterial] + let params:[AGSGPParameterValue] = [paramLoc, paramDegree, paramTime, paramType, paramMaterial] return params } diff --git a/AsynchronousGPSample/swift/AsynchronousGP/AsyncGPSettingsViewController.swift b/AsynchronousGPSample/swift/AsynchronousGP/AsyncGPSettingsViewController.swift index 066d190dc..ed5fca1f9 100644 --- a/AsynchronousGPSample/swift/AsynchronousGP/AsyncGPSettingsViewController.swift +++ b/AsynchronousGPSample/swift/AsynchronousGP/AsyncGPSettingsViewController.swift @@ -25,7 +25,8 @@ class AsyncGPSettingsViewController:UIViewController, UIPickerViewDelegate, UIPi override func viewDidLoad() { //update view to show selected material - if let index = find(self.materialsArray, self.parameters.materialType) { + + if let index = self.materialsArray.indexOf(self.parameters.materialType) { self.materialPicker.selectRow(index, inComponent: 0, animated: true) self.materialLabel.text = self.parameters.materialType } @@ -44,7 +45,7 @@ class AsyncGPSettingsViewController:UIViewController, UIPickerViewDelegate, UIPi func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { return self.materialsArray.count } - func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String! { + func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { return self.materialsArray[row] } diff --git a/AsynchronousGPSample/swift/AsynchronousGP/Info.plist b/AsynchronousGPSample/swift/AsynchronousGP/Info.plist index a777a9e61..90ab0a0b8 100644 --- a/AsynchronousGPSample/swift/AsynchronousGP/Info.plist +++ b/AsynchronousGPSample/swift/AsynchronousGP/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.esri.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -22,6 +22,30 @@ 1 LSRequiresIPhoneOS + NSAppTransportSecurity + + NSExceptionDomains + + arcgis.com + + NSIncludesSubdomains + + NSThirdPartyExceptionAllowsInsecureHTTPLoads + + NSThirdPartyExceptionRequiresForwardSecrecy + + + arcgisonline.com + + NSIncludesSubdomains + + NSThirdPartyExceptionAllowsInsecureHTTPLoads + + NSThirdPartyExceptionRequiresForwardSecrecy + + + + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -43,29 +67,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - NSAppTransportSecurity - - NSExceptionDomains - - arcgisonline.com - - NSIncludesSubdomains - - NSThirdPartyExceptionAllowsInsecureHTTPLoads - - NSThirdPartyExceptionRequiresForwardSecrecy - - - arcgis.com - - NSIncludesSubdomains - - NSThirdPartyExceptionAllowsInsecureHTTPLoads - - NSThirdPartyExceptionRequiresForwardSecrecy - - - - diff --git a/AsynchronousGPSample/swift/AsynchronousGP/ViewController.swift b/AsynchronousGPSample/swift/AsynchronousGP/ViewController.swift index cedd2e1d5..ef0d7c9d8 100644 --- a/AsynchronousGPSample/swift/AsynchronousGP/ViewController.swift +++ b/AsynchronousGPSample/swift/AsynchronousGP/ViewController.swift @@ -29,13 +29,13 @@ class ViewController:UIViewController, AGSMapViewTouchDelegate, AGSGeoprocessorD override func viewDidLoad() { //Add teh basemap - var mapUrl = NSURL(string: kDefaultMap) - var tiledLayer = AGSTiledMapServiceLayer(URL: mapUrl) + let mapUrl = NSURL(string: kDefaultMap) + let tiledLayer = AGSTiledMapServiceLayer(URL: mapUrl) self.mapView.addMapLayer(tiledLayer) //Zooming to an intial envelope with the specified spatial reference of the map - var spatialReference = AGSSpatialReference(WKID: 102100) - var envelope = AGSEnvelope(xmin: -13639984, ymin: 4537387, xmax: -13606734, ymax: 4558866, spatialReference: spatialReference) + let spatialReference = AGSSpatialReference(WKID: 102100) + let envelope = AGSEnvelope(xmin: -13639984, ymin: 4537387, xmax: -13606734, ymax: 4558866, spatialReference: spatialReference) self.mapView.zoomToEnvelope(envelope, animated: true) //important step in detecting the touch events on the map @@ -71,18 +71,18 @@ class ViewController:UIViewController, AGSMapViewTouchDelegate, AGSGeoprocessorD self.graphicsLayer?.removeAllGraphics() //create a symbol to show user tap location on map - var myMarkerSymbol = AGSSimpleMarkerSymbol.simpleMarkerSymbolWithColor(UIColor(red: 0.0, green: 1.0, blue: 0.0, alpha: 0.25)) as! AGSSimpleMarkerSymbol + let myMarkerSymbol = AGSSimpleMarkerSymbol.simpleMarkerSymbolWithColor(UIColor(red: 0.0, green: 1.0, blue: 0.0, alpha: 0.25)) as! AGSSimpleMarkerSymbol myMarkerSymbol.size = CGSizeMake(10, 10) myMarkerSymbol.outline = AGSSimpleLineSymbol(color: UIColor.redColor(), width: 1) //create a graphic - var graphic = AGSGraphic(geometry: mappoint, symbol: myMarkerSymbol, attributes: nil) + let graphic = AGSGraphic(geometry: mappoint, symbol: myMarkerSymbol, attributes: nil) //add graphic to graphics layer self.graphicsLayer.addGraphic(graphic) //create a feature set for the input parameter - var featureSet = AGSFeatureSet() + let featureSet = AGSFeatureSet() featureSet.features = [graphic] //assign the new feature set and wind direction values to the parameter object @@ -90,7 +90,7 @@ class ViewController:UIViewController, AGSMapViewTouchDelegate, AGSGeoprocessorD self.parameters.windDirection = NSDecimalNumber(float: self.wdDegreeSlider.value) //get the parameters array from the parameters object - var parametersArray = self.parameters.parametersArray() + let parametersArray = self.parameters.parametersArray() //submit the gp job //the interval property of the gptask is not set to a value explicitly, default is 5 sec @@ -116,11 +116,11 @@ class ViewController:UIViewController, AGSMapViewTouchDelegate, AGSGeoprocessorD func geoprocessor(geoprocessor: AGSGeoprocessor!, operation op: NSOperation!, didQueryWithResult result: AGSGPParameterValue!, forJob jobId: String!) { //get the result - var featureSet = result.value as! AGSFeatureSet + let featureSet = result.value as! AGSFeatureSet //loop through all the graphics in feature set and add them to the map for graphic in featureSet.features { //create and set a symbol to graphic - var fillSymbol = AGSSimpleFillSymbol.simpleFillSymbol() as! AGSSimpleFillSymbol + let fillSymbol = AGSSimpleFillSymbol.simpleFillSymbol() as! AGSSimpleFillSymbol fillSymbol.color = UIColor.purpleColor().colorWithAlphaComponent(0.25) (graphic as! AGSGraphic).symbol = fillSymbol @@ -129,7 +129,7 @@ class ViewController:UIViewController, AGSMapViewTouchDelegate, AGSGeoprocessorD } //zoom to the graphic layer extent - var envelope = self.graphicsLayer.fullEnvelope.mutableCopy() as! AGSMutableEnvelope + let envelope = self.graphicsLayer.fullEnvelope.mutableCopy() as! AGSMutableEnvelope envelope.expandByFactor(1.2) self.mapView.zoomToEnvelope(envelope, animated: true) @@ -155,7 +155,7 @@ class ViewController:UIViewController, AGSMapViewTouchDelegate, AGSGeoprocessorD func geoprocessor(geoprocessor: AGSGeoprocessor!, operation op: NSOperation!, jobDidFail jobInfo: AGSGPJobInfo!) { self.dismissHUD() for message in jobInfo.messages { - println("\((message as! AGSGPMessage).description)") + print("\((message as! AGSGPMessage).description)") } //Update status diff --git a/ClosestFacilitySample/swift/ClosestFacility.xcodeproj/project.pbxproj b/ClosestFacilitySample/swift/ClosestFacility.xcodeproj/project.pbxproj index ed5b57b17..75edba546 100644 --- a/ClosestFacilitySample/swift/ClosestFacility.xcodeproj/project.pbxproj +++ b/ClosestFacilitySample/swift/ClosestFacility.xcodeproj/project.pbxproj @@ -123,7 +123,8 @@ 3E5B62851A251DF900695EB8 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0610; + LastSwiftUpdateCheck = 0720; + LastUpgradeCheck = 0720; ORGANIZATIONNAME = Esri; TargetAttributes = { 3E5B628C1A251DF900695EB8 = { @@ -217,6 +218,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -291,6 +293,7 @@ "-l", "c++", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.esri.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -310,6 +313,7 @@ "-l", "c++", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.esri.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; diff --git a/ClosestFacilitySample/swift/ClosestFacility/Controllers/ClosestFacilityViewController.swift b/ClosestFacilitySample/swift/ClosestFacility/Controllers/ClosestFacilityViewController.swift index d5227ef75..5f24bd19b 100644 --- a/ClosestFacilitySample/swift/ClosestFacility/Controllers/ClosestFacilityViewController.swift +++ b/ClosestFacilitySample/swift/ClosestFacility/Controllers/ClosestFacilityViewController.swift @@ -104,7 +104,7 @@ class ClosestFacilityViewController: UIViewController, AGSMapViewLayerDelegate, // create a custom callout view using a button with an image // this is to remove incidents and barriers after we add them to the map let customView = UIView(frame: CGRect(x: 0, y: 0, width: 40, height: 24)) - let deleteBtn = UIButton.buttonWithType(.Custom) as! UIButton + let deleteBtn = UIButton(type: .Custom) deleteBtn.frame = CGRect(x: 8, y: 0, width: 24, height: 24) deleteBtn.setImage(UIImage(named: "remove24.png"), forState:.Normal) deleteBtn.addTarget(self, action: "removeIncidentBarrierClicked", forControlEvents: .TouchUpInside) @@ -199,7 +199,7 @@ class ClosestFacilityViewController: UIViewController, AGSMapViewLayerDelegate, self.statusMessageLabel.text = "Tap reset to start over" //zoom to graphics layer extent - var env = self.graphicsLayer.fullEnvelope as! AGSMutableEnvelope + let env = self.graphicsLayer.fullEnvelope as! AGSMutableEnvelope env.expandByFactor(1.2) self.mapView.zoomToEnvelope(env, animated:true) } @@ -270,7 +270,7 @@ class ClosestFacilityViewController: UIViewController, AGSMapViewLayerDelegate, //stop activity indicator // SVProgressHUD.dismiss() - UIAlertView(title: "Error", message: error.localizedDescription, delegate: nil, cancelButtonTitle: "OK") + UIAlertView(title: "Error", message: error.localizedDescription, delegate: nil, cancelButtonTitle: "OK").show() } //MARK: - Action Methods @@ -360,7 +360,8 @@ class ClosestFacilityViewController: UIViewController, AGSMapViewLayerDelegate, // if we have a sketch layer on the map, remove it if self.sketchLayer != nil { - if contains(self.mapView.mapLayers as! [AGSLayer], self.sketchLayer) { + let layers = self.mapView.mapLayers as! [AGSLayer] + if layers.contains(self.sketchLayer) { self.mapView.removeMapLayerWithName(self.sketchLayer.name) self.mapView.touchDelegate = nil self.sketchLayer = nil @@ -447,7 +448,7 @@ class ClosestFacilityViewController: UIViewController, AGSMapViewLayerDelegate, func removeIncidentBarrierClicked() { //redunce the incident number is the removed item is an incident point - if let incidentNum = self.selectedGraphic.attributeAsStringForKey("incidentNumber") { + if let _ = self.selectedGraphic.attributeAsStringForKey("incidentNumber") { self.numIncidents-- if self.numIncidents == 0 { //disable the findCFButton @@ -456,7 +457,7 @@ class ClosestFacilityViewController: UIViewController, AGSMapViewLayerDelegate, } //redunce the barrier number is the removed item is a barrier polygon - if let let barrierNum = self.selectedGraphic.attributeAsStringForKey("barrierNumber") { + if let _ = self.selectedGraphic.attributeAsStringForKey("barrierNumber") { self.numBarriers-- } diff --git a/ClosestFacilitySample/swift/ClosestFacility/Info.plist b/ClosestFacilitySample/swift/ClosestFacility/Info.plist index a777a9e61..90ab0a0b8 100644 --- a/ClosestFacilitySample/swift/ClosestFacility/Info.plist +++ b/ClosestFacilitySample/swift/ClosestFacility/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.esri.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -22,6 +22,30 @@ 1 LSRequiresIPhoneOS + NSAppTransportSecurity + + NSExceptionDomains + + arcgis.com + + NSIncludesSubdomains + + NSThirdPartyExceptionAllowsInsecureHTTPLoads + + NSThirdPartyExceptionRequiresForwardSecrecy + + + arcgisonline.com + + NSIncludesSubdomains + + NSThirdPartyExceptionAllowsInsecureHTTPLoads + + NSThirdPartyExceptionRequiresForwardSecrecy + + + + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -43,29 +67,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - NSAppTransportSecurity - - NSExceptionDomains - - arcgisonline.com - - NSIncludesSubdomains - - NSThirdPartyExceptionAllowsInsecureHTTPLoads - - NSThirdPartyExceptionRequiresForwardSecrecy - - - arcgis.com - - NSIncludesSubdomains - - NSThirdPartyExceptionAllowsInsecureHTTPLoads - - NSThirdPartyExceptionRequiresForwardSecrecy - - - - diff --git a/CustomCalloutSample/swift/CustomCallout.xcodeproj/project.pbxproj b/CustomCalloutSample/swift/CustomCallout.xcodeproj/project.pbxproj index 0c3eeedef..bffb541c2 100644 --- a/CustomCalloutSample/swift/CustomCallout.xcodeproj/project.pbxproj +++ b/CustomCalloutSample/swift/CustomCallout.xcodeproj/project.pbxproj @@ -115,7 +115,8 @@ 3EF99AB91A2CFD1700652879 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0610; + LastSwiftUpdateCheck = 0720; + LastUpgradeCheck = 0720; ORGANIZATIONNAME = Esri; TargetAttributes = { 3EF99AC01A2CFD1700652879 = { @@ -209,6 +210,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -283,6 +285,7 @@ "-l", "c++", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.esri.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -302,6 +305,7 @@ "-l", "c++", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.esri.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; diff --git a/CustomCalloutSample/swift/CustomCallout/Controllers/CustomCalloutViewController.swift b/CustomCalloutSample/swift/CustomCallout/Controllers/CustomCalloutViewController.swift index a3329dd36..b3c676a61 100644 --- a/CustomCalloutSample/swift/CustomCallout/Controllers/CustomCalloutViewController.swift +++ b/CustomCalloutSample/swift/CustomCallout/Controllers/CustomCalloutViewController.swift @@ -99,7 +99,7 @@ class CustomCalloutViewController: UIViewController, AGSCalloutDelegate { switch graphicType { //graphic's callout is an embedded map view case .EmbeddedMapView: - println("Tapped on Building") + print("Tapped on Building") //call the helper method to update the hybrid map view according to the graphic self.hybridViewController.showHybridMapAtGraphic(graphic) @@ -111,7 +111,7 @@ class CustomCalloutViewController: UIViewController, AGSCalloutDelegate { //graphic's callout is an embedded map view case .EmbeddedWebView: - println("Tapped on Camera") + print("Tapped on Camera") //get the url for the image feed from the camera if let imageURL = graphic.attributeAsStringForKey("url") { @@ -130,7 +130,7 @@ class CustomCalloutViewController: UIViewController, AGSCalloutDelegate { //graphic's callout is a view with title, detail, custom accessory button and an image. case .CustomInfoView: - println("Tapped on McDonalds") + print("Tapped on McDonalds") //clear the custom view. self.mapView.callout.customView = nil @@ -151,7 +151,7 @@ class CustomCalloutViewController: UIViewController, AGSCalloutDelegate { //graphic's callout is a simple view with just the title and detail case .SimpleView: - println("Tapped on Monument") + print("Tapped on Monument") //clear the custom view. self.mapView.callout.customView = nil @@ -165,9 +165,6 @@ class CustomCalloutViewController: UIViewController, AGSCalloutDelegate { self.mapView.callout.image = nil return true - - default: - break } } @@ -179,20 +176,20 @@ class CustomCalloutViewController: UIViewController, AGSCalloutDelegate { let graphic = callout.representedFeature as! AGSGraphic //extract the type of graphics to check. var exists = ObjCBool(false) - var typeNumber = graphic.attributeAsIntegerForKey("type", exists: &exists) + let typeNumber = graphic.attributeAsIntegerForKey("type", exists: &exists) if (exists) { if let graphicType = GraphicType(rawValue: typeNumber) { switch graphicType { //only this graphic's callout has an accessory view. case .CustomInfoView: - println("Tapped accessory button on McDonalds callout") + print("Tapped accessory button on McDonalds callout") //get the phone number and create the proper string. if let phoneString = graphic.attributeAsStringForKey("phone") { let phoneNumber = "tel://\(phoneString)" //call the number. - UIApplication.sharedApplication().openURL(NSURL(string: phoneString)!) + UIApplication.sharedApplication().openURL(NSURL(string: phoneNumber)!) } default: diff --git a/CustomCalloutSample/swift/CustomCallout/Info.plist b/CustomCalloutSample/swift/CustomCallout/Info.plist index a777a9e61..1482601ba 100644 --- a/CustomCalloutSample/swift/CustomCallout/Info.plist +++ b/CustomCalloutSample/swift/CustomCallout/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.esri.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -22,6 +22,39 @@ 1 LSRequiresIPhoneOS + NSAppTransportSecurity + + NSExceptionDomains + + arcgis.com + + NSIncludesSubdomains + + NSThirdPartyExceptionAllowsInsecureHTTPLoads + + NSThirdPartyExceptionRequiresForwardSecrecy + + + arcgisonline.com + + NSIncludesSubdomains + + NSThirdPartyExceptionAllowsInsecureHTTPLoads + + NSThirdPartyExceptionRequiresForwardSecrecy + + + trimarc.org + + NSIncludesSubdomains + + NSThirdPartyExceptionAllowsInsecureHTTPLoads + + NSThirdPartyExceptionRequiresForwardSecrecy + + + + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -43,29 +76,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - NSAppTransportSecurity - - NSExceptionDomains - - arcgisonline.com - - NSIncludesSubdomains - - NSThirdPartyExceptionAllowsInsecureHTTPLoads - - NSThirdPartyExceptionRequiresForwardSecrecy - - - arcgis.com - - NSIncludesSubdomains - - NSThirdPartyExceptionAllowsInsecureHTTPLoads - - NSThirdPartyExceptionRequiresForwardSecrecy - - - - diff --git a/DownloadTileCacheSample/swift/DownloadTileCache.xcodeproj/project.pbxproj b/DownloadTileCacheSample/swift/DownloadTileCache.xcodeproj/project.pbxproj index 52625cb0d..fbfa1b6d0 100644 --- a/DownloadTileCacheSample/swift/DownloadTileCache.xcodeproj/project.pbxproj +++ b/DownloadTileCacheSample/swift/DownloadTileCache.xcodeproj/project.pbxproj @@ -151,7 +151,8 @@ 3EF4A6C81A1EC1A300028AD9 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0610; + LastSwiftUpdateCheck = 0720; + LastUpgradeCheck = 0720; ORGANIZATIONNAME = Esri; TargetAttributes = { 3EF4A6CF1A1EC1A300028AD9 = { @@ -252,6 +253,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -327,6 +329,7 @@ "-l", "c++", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.esri.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "DownloadTileCache/DownloadTileCache-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -349,6 +352,7 @@ "-l", "c++", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.esri.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "DownloadTileCache/DownloadTileCache-Bridging-Header.h"; }; diff --git a/DownloadTileCacheSample/swift/DownloadTileCache/AppDelegate.swift b/DownloadTileCacheSample/swift/DownloadTileCache/AppDelegate.swift index d515dce0c..fccb8b8ae 100644 --- a/DownloadTileCacheSample/swift/DownloadTileCache/AppDelegate.swift +++ b/DownloadTileCacheSample/swift/DownloadTileCache/AppDelegate.swift @@ -29,7 +29,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { //request permission for local notifications in iOS 8 if(UIApplication.instancesRespondToSelector(Selector("registerUserNotificationSettings:"))) { - application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: UIUserNotificationType.Sound | UIUserNotificationType.Alert | UIUserNotificationType.Badge, categories: nil)) + if #available(iOS 8.0, *) { + application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: [.Sound, .Alert, .Badge], categories: nil)) + } else { + // Fallback on earlier versions + } } return true } diff --git a/DownloadTileCacheSample/swift/DownloadTileCache/Helpers/BackgroundHelper.swift b/DownloadTileCacheSample/swift/DownloadTileCache/Helpers/BackgroundHelper.swift index 4b10bb639..102ce6c02 100644 --- a/DownloadTileCacheSample/swift/DownloadTileCache/Helpers/BackgroundHelper.swift +++ b/DownloadTileCacheSample/swift/DownloadTileCache/Helpers/BackgroundHelper.swift @@ -39,11 +39,11 @@ class BackgroundHelper { class func postLocalNotificationIfAppNotActive(message:String) { //Only post notification if app not active - var state = UIApplication.sharedApplication().applicationState + let state = UIApplication.sharedApplication().applicationState if state != .Active { - var localNotification = UILocalNotification() + let localNotification = UILocalNotification() localNotification.alertBody = message UIApplication.sharedApplication().scheduleLocalNotification(localNotification) } diff --git a/DownloadTileCacheSample/swift/DownloadTileCache/Helpers/MessageHelper.swift b/DownloadTileCacheSample/swift/DownloadTileCache/Helpers/MessageHelper.swift index 63b5b545c..9d2a5ca33 100644 --- a/DownloadTileCacheSample/swift/DownloadTileCache/Helpers/MessageHelper.swift +++ b/DownloadTileCacheSample/swift/DownloadTileCache/Helpers/MessageHelper.swift @@ -35,7 +35,7 @@ class MessageHelper { if !range.isEmpty { var substring = percentageString.substringFromIndex(range.endIndex) as String - substring = substring.stringByReplacingOccurrencesOfString(" percent", withString: "", options: nil, range: nil) + substring = substring.stringByReplacingOccurrencesOfString(" percent", withString: "", options: .CaseInsensitiveSearch, range: nil) message = message.stringByAppendingString(" (\(substring)% completed)") } } diff --git a/DownloadTileCacheSample/swift/DownloadTileCache/Info.plist b/DownloadTileCacheSample/swift/DownloadTileCache/Info.plist index 3f0c51d1d..8ae88523e 100644 --- a/DownloadTileCacheSample/swift/DownloadTileCache/Info.plist +++ b/DownloadTileCacheSample/swift/DownloadTileCache/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.esri.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -22,6 +22,30 @@ 1 LSRequiresIPhoneOS + NSAppTransportSecurity + + NSExceptionDomains + + arcgis.com + + NSIncludesSubdomains + + NSThirdPartyExceptionAllowsInsecureHTTPLoads + + NSThirdPartyExceptionRequiresForwardSecrecy + + + arcgisonline.com + + NSIncludesSubdomains + + NSThirdPartyExceptionAllowsInsecureHTTPLoads + + NSThirdPartyExceptionRequiresForwardSecrecy + + + + UIBackgroundModes fetch @@ -47,29 +71,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - NSAppTransportSecurity - - NSExceptionDomains - - arcgisonline.com - - NSIncludesSubdomains - - NSThirdPartyExceptionAllowsInsecureHTTPLoads - - NSThirdPartyExceptionRequiresForwardSecrecy - - - arcgis.com - - NSIncludesSubdomains - - NSThirdPartyExceptionAllowsInsecureHTTPLoads - - NSThirdPartyExceptionRequiresForwardSecrecy - - - - diff --git a/DownloadTileCacheSample/swift/DownloadTileCache/ViewController.swift b/DownloadTileCacheSample/swift/DownloadTileCache/ViewController.swift index 97e7964c2..e6e66fe2f 100644 --- a/DownloadTileCacheSample/swift/DownloadTileCache/ViewController.swift +++ b/DownloadTileCacheSample/swift/DownloadTileCache/ViewController.swift @@ -81,8 +81,7 @@ class ViewController: UIViewController, AGSLayerDelegate { } //MARK: - KVO - - override func observeValueForKeyPath(keyPath: String, ofObject object: AnyObject, change: [NSObject : AnyObject], context: UnsafeMutablePointer) { + override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer) { //Clear out any estimate or previously chosen levels by the user //They are no longer relevant as the map's scale has changed //Disable buttons to force the user to specify levels again @@ -95,7 +94,9 @@ class ViewController: UIViewController, AGSLayerDelegate { //Re-initialize the stepper with possible values based on current map scale if self.tiledLayer.currentLOD() != nil { - if let index = find(self.tiledLayer.mapServiceInfo.tileInfo.lods as! [AGSLOD], self.tiledLayer.currentLOD()) { + let lods = self.tiledLayer.mapServiceInfo.tileInfo.lods as! [AGSLOD] + + if let index = lods.indexOf(self.tiledLayer.currentLOD()) { self.levelStepper.maximumValue = Double(self.tiledLayer.tileInfo.lods.count - index) self.levelStepper.minimumValue = 0 self.levelStepper.value = 0 @@ -125,7 +126,7 @@ class ViewController: UIViewController, AGSLayerDelegate { //Prepare list of levels to download let desiredLevels = self.levelsWithCount(Int(self.levelStepper.value), startingAt:self.tiledLayer.currentLOD(), fromLODs:self.tiledLayer.tileInfo.lods as! [AGSLOD]) - println("LODs requested \(desiredLevels)") + print("LODs requested \(desiredLevels)") //Use current envelope to download let extent = self.mapView.visibleAreaEnvelope @@ -136,7 +137,7 @@ class ViewController: UIViewController, AGSLayerDelegate { //kick-off operation to estimate size self.tileCacheTask.estimateTileCacheSizeWithParameters(params, status: { (status, userInfo) -> Void in - println("\(AGSResumableTaskJobStatusAsString(status)), \(userInfo)") + print("\(AGSResumableTaskJobStatusAsString(status)), \(userInfo)") }) { (tileCacheSizeEstimate, error) -> Void in @@ -168,7 +169,7 @@ class ViewController: UIViewController, AGSLayerDelegate { //Prepare list of levels to download let desiredLevels = self.levelsWithCount(Int(self.levelStepper.value), startingAt:self.tiledLayer.currentLOD(), fromLODs:self.tiledLayer.tileInfo.lods as! [AGSLOD]) - println("LODs requested \(desiredLevels)") + print("LODs requested \(desiredLevels)") //Use current envelope to download let extent = self.mapView.visibleAreaEnvelope @@ -179,7 +180,7 @@ class ViewController: UIViewController, AGSLayerDelegate { //Kick-off operation self.tileCacheTask.exportTileCacheWithParameters(params, downloadFolderPath: nil, useExisting: true, status: { (status, userInfo) -> Void in //Print the job status - println("\(AGSResumableTaskJobStatusAsString(status)), \(userInfo)") + print("\(AGSResumableTaskJobStatusAsString(status)), \(userInfo)") if userInfo != nil { let allMessages = userInfo["messages"] as? [AGSGPMessage] @@ -189,7 +190,7 @@ class ViewController: UIViewController, AGSLayerDelegate { let totalBytesExpected = userInfo["AGSDownloadProgressTotalBytesExpected"] as? Double if totalBytesDownloaded != nil && totalBytesExpected != nil { let dPercentage = totalBytesDownloaded!/totalBytesExpected! - println("\(totalBytesDownloaded) / \(totalBytesExpected) = \(dPercentage)") + print("\(totalBytesDownloaded) / \(totalBytesExpected) = \(dPercentage)") SVProgressHUD.showProgress(Float(dPercentage), status: "Downloading", maskType: 4) } } @@ -197,7 +198,7 @@ class ViewController: UIViewController, AGSLayerDelegate { //Else, display latest progress message provided by the service if let message = MessageHelper.extractMostRecentMessage(allMessages!) { - println(message) + print(message) SVProgressHUD.showWithStatus(message, maskType:4) } } @@ -234,7 +235,7 @@ class ViewController: UIViewController, AGSLayerDelegate { func levelsWithCount(count:Int, startingAt startLOD:AGSLOD, fromLODs allLODs:[AGSLOD]) -> [UInt] { - if let index = find(allLODs, startLOD) { + if let index = allLODs.indexOf(startLOD) { let endIndex = index + count-1 let desiredLODs = Array(allLODs[index...endIndex]) var desiredLevels = [UInt]() diff --git a/DynamicSubLayerReorderSample/swift/DynamicSubLayerReorder.xcodeproj/project.pbxproj b/DynamicSubLayerReorderSample/swift/DynamicSubLayerReorder.xcodeproj/project.pbxproj index 124c5badb..3dfdea898 100644 --- a/DynamicSubLayerReorderSample/swift/DynamicSubLayerReorder.xcodeproj/project.pbxproj +++ b/DynamicSubLayerReorderSample/swift/DynamicSubLayerReorder.xcodeproj/project.pbxproj @@ -115,7 +115,8 @@ 3EC2F6091A6450DA003CA123 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0610; + LastSwiftUpdateCheck = 0720; + LastUpgradeCheck = 0720; ORGANIZATIONNAME = Esri; TargetAttributes = { 3EC2F6101A6450DA003CA123 = { @@ -209,6 +210,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -283,6 +285,7 @@ "-l", "c++", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.esri.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -302,6 +305,7 @@ "-l", "c++", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.esri.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; @@ -325,6 +329,7 @@ 3EC2F6321A6450DA003CA123 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/DynamicSubLayerReorderSample/swift/DynamicSubLayerReorder/Controllers/LayersListViewController.swift b/DynamicSubLayerReorderSample/swift/DynamicSubLayerReorder/Controllers/LayersListViewController.swift index 0852abb02..7968e97af 100644 --- a/DynamicSubLayerReorderSample/swift/DynamicSubLayerReorder/Controllers/LayersListViewController.swift +++ b/DynamicSubLayerReorderSample/swift/DynamicSubLayerReorder/Controllers/LayersListViewController.swift @@ -81,7 +81,7 @@ class LayersListViewController: UIViewController, OptionsDelegate, UITableViewDa func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let reusableIdentifier = "LayersListCell" - let cell = tableView.dequeueReusableCellWithIdentifier(reusableIdentifier) as! UITableViewCell + let cell = tableView.dequeueReusableCellWithIdentifier(reusableIdentifier)! let layerInfo = self.layerInfos[indexPath.row] cell.textLabel?.text = layerInfo.name @@ -127,7 +127,7 @@ class LayersListViewController: UIViewController, OptionsDelegate, UITableViewDa self.updateAddButtonStatus() } else { - println("Editing style other than delete") + print("Editing style other than delete") } } @@ -177,7 +177,7 @@ class LayersListViewController: UIViewController, OptionsDelegate, UITableViewDa //hide the popover controller self.popover.dismissPopoverAnimated(true) //remove the layer info from deleted layer Infos - if let index = find(self.deletedLayerInfos, option) { + if let index = self.deletedLayerInfos.indexOf(option) { self.deletedLayerInfos.removeAtIndex(index) } //and add it to the layer infos diff --git a/DynamicSubLayerReorderSample/swift/DynamicSubLayerReorder/Controllers/OptionsViewController.swift b/DynamicSubLayerReorderSample/swift/DynamicSubLayerReorder/Controllers/OptionsViewController.swift index d4f69e10d..7f79e3e2b 100644 --- a/DynamicSubLayerReorderSample/swift/DynamicSubLayerReorder/Controllers/OptionsViewController.swift +++ b/DynamicSubLayerReorderSample/swift/DynamicSubLayerReorder/Controllers/OptionsViewController.swift @@ -60,7 +60,7 @@ class OptionsViewController: UITableViewController { override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let reusableIdentifier = "OptionCell" - var cell = tableView.dequeueReusableCellWithIdentifier(reusableIdentifier) as? UITableViewCell + var cell = tableView.dequeueReusableCellWithIdentifier(reusableIdentifier) if cell == nil { cell = UITableViewCell(style: .Default, reuseIdentifier: reusableIdentifier) } diff --git a/DynamicSubLayerReorderSample/swift/DynamicSubLayerReorder/Info.plist b/DynamicSubLayerReorderSample/swift/DynamicSubLayerReorder/Info.plist index 48432a2ef..5d39c6b46 100644 --- a/DynamicSubLayerReorderSample/swift/DynamicSubLayerReorder/Info.plist +++ b/DynamicSubLayerReorderSample/swift/DynamicSubLayerReorder/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.esri.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -22,6 +22,30 @@ 1 LSRequiresIPhoneOS + NSAppTransportSecurity + + NSExceptionDomains + + arcgis.com + + NSIncludesSubdomains + + NSThirdPartyExceptionAllowsInsecureHTTPLoads + + NSThirdPartyExceptionRequiresForwardSecrecy + + + arcgisonline.com + + NSIncludesSubdomains + + NSThirdPartyExceptionAllowsInsecureHTTPLoads + + NSThirdPartyExceptionRequiresForwardSecrecy + + + + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -37,29 +61,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - NSAppTransportSecurity - - NSExceptionDomains - - arcgisonline.com - - NSIncludesSubdomains - - NSThirdPartyExceptionAllowsInsecureHTTPLoads - - NSThirdPartyExceptionRequiresForwardSecrecy - - - arcgis.com - - NSIncludesSubdomains - - NSThirdPartyExceptionAllowsInsecureHTTPLoads - - NSThirdPartyExceptionRequiresForwardSecrecy - - - - diff --git a/FeatureLayerEditingSample/swift/FeatureLayerEditing.xcodeproj/project.pbxproj b/FeatureLayerEditingSample/swift/FeatureLayerEditing.xcodeproj/project.pbxproj index 18865dea5..b278ca788 100644 --- a/FeatureLayerEditingSample/swift/FeatureLayerEditing.xcodeproj/project.pbxproj +++ b/FeatureLayerEditingSample/swift/FeatureLayerEditing.xcodeproj/project.pbxproj @@ -124,7 +124,8 @@ 97F6673C19E224E9001D1724 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0600; + LastSwiftUpdateCheck = 0720; + LastUpgradeCheck = 0720; ORGANIZATIONNAME = Esri; TargetAttributes = { 97F6674319E224E9001D1724 = { @@ -219,6 +220,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -292,6 +294,7 @@ "-l", "c++", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.esri.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "SVProgressHUD/SVProgressHUD-Bridging-Header.h"; }; @@ -311,6 +314,7 @@ "-l", "c++", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.esri.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "SVProgressHUD/SVProgressHUD-Bridging-Header.h"; }; diff --git a/FeatureLayerEditingSample/swift/FeatureLayerEditing/Base.lproj/Main.storyboard b/FeatureLayerEditingSample/swift/FeatureLayerEditing/Base.lproj/Main.storyboard index 60107095d..ddda4b402 100644 --- a/FeatureLayerEditingSample/swift/FeatureLayerEditing/Base.lproj/Main.storyboard +++ b/FeatureLayerEditingSample/swift/FeatureLayerEditing/Base.lproj/Main.storyboard @@ -1,7 +1,8 @@ - + - + + @@ -28,10 +29,10 @@ -