From 696ec76de59bbd64929b938282ba0773c83d09aa Mon Sep 17 00:00:00 2001 From: Mark Dostal Date: Mon, 2 Aug 2021 14:26:16 -0500 Subject: [PATCH 1/7] Fix for XCode 13 issue relating to "unavailable api in application extensions". --- Sources/ArcGISToolkit/Extensions.swift | 17 ----------------- Sources/ArcGISToolkit/MeasureToolbar.swift | 22 ++++++++++++++++++---- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/Sources/ArcGISToolkit/Extensions.swift b/Sources/ArcGISToolkit/Extensions.swift index 6806d3d..b4585fb 100644 --- a/Sources/ArcGISToolkit/Extensions.swift +++ b/Sources/ArcGISToolkit/Extensions.swift @@ -14,23 +14,6 @@ import Foundation import UIKit -extension UIApplication { - func topViewController(_ controller: UIViewController? = UIApplication.shared.windows.first(where: { $0.isKeyWindow })?.rootViewController) -> UIViewController? { - if let navigationController = controller as? UINavigationController { - return topViewController(navigationController.visibleViewController) - } - if let tabController = controller as? UITabBarController { - if let selected = tabController.selectedViewController { - return topViewController(selected) - } - } - if let presented = controller?.presentedViewController { - return topViewController(presented) - } - return controller - } -} - #if !SWIFT_PACKAGE // This is a workaround for cocoapods compatibility. extension Bundle { diff --git a/Sources/ArcGISToolkit/MeasureToolbar.swift b/Sources/ArcGISToolkit/MeasureToolbar.swift index 45baea0..75c810b 100644 --- a/Sources/ArcGISToolkit/MeasureToolbar.swift +++ b/Sources/ArcGISToolkit/MeasureToolbar.swift @@ -159,7 +159,8 @@ private enum MeasureToolbarMode { case feature } -public class MeasureToolbar: UIToolbar, AGSGeoViewTouchDelegate { +@available(iOSApplicationExtension, unavailable) +public class MeasureToolbar: UIToolbar, AGSGeoViewTouchDelegate, UnitsViewControllerDelegate { // Exposed so that the user can customize the sketch editor styles. // Consumers of the MeasureToolbar should not mutate the sketch editor state // other than it's style. @@ -462,7 +463,7 @@ public class MeasureToolbar: UIToolbar, AGSGeoViewTouchDelegate { let navigationController = UINavigationController(rootViewController: unitsViewController) navigationController.modalPresentationStyle = .formSheet - UIApplication.shared.topViewController()?.present(navigationController, animated: true) + topViewController()?.present(navigationController, animated: true) } /// Called in response to @@ -671,9 +672,7 @@ public class MeasureToolbar: UIToolbar, AGSGeoViewTouchDelegate { } return nil } -} -extension MeasureToolbar: UnitsViewControllerDelegate { public func unitsViewControllerDidCancel(_ unitsViewController: UnitsViewController) { unitsViewController.dismiss(animated: true) } @@ -689,4 +688,19 @@ extension MeasureToolbar: UnitsViewControllerDelegate { fatalError("Unsupported unit type") } } + + func topViewController(_ controller: UIViewController? = UIApplication.shared.windows.first(where: { $0.isKeyWindow })?.rootViewController) -> UIViewController? { + if let navigationController = controller as? UINavigationController { + return topViewController(navigationController.visibleViewController) + } + if let tabController = controller as? UITabBarController { + if let selected = tabController.selectedViewController { + return topViewController(selected) + } + } + if let presented = controller?.presentedViewController { + return topViewController(presented) + } + return controller + } } From 2ed935a8b1624f094ff7842da9b088a9b5fe2547 Mon Sep 17 00:00:00 2001 From: Mark Dostal Date: Mon, 2 Aug 2021 16:15:56 -0500 Subject: [PATCH 2/7] Update .swiftlint.yml --- .swiftlint.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.swiftlint.yml b/.swiftlint.yml index 09345d6..798325b 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -63,3 +63,6 @@ disabled_rules: trailing_whitespace: ignores_empty_lines: true + +excluded: + - Pods From d3438a3d166dc65244c11e060f36a4169f43992c Mon Sep 17 00:00:00 2001 From: Mark Dostal Date: Mon, 2 Aug 2021 16:38:16 -0500 Subject: [PATCH 3/7] Update doc URLs based on the new developer site. --- Documentation/AR/README.md | 2 +- Sources/ArcGISToolkit/JobManager.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/AR/README.md b/Documentation/AR/README.md index e3d3bc0..ed7e114 100644 --- a/Documentation/AR/README.md +++ b/Documentation/AR/README.md @@ -1,6 +1,6 @@ # Augmented reality (AR) -[![guide doc](https://img.shields.io/badge/Full_Developers_Guide-Doc-purple)](https://developers.arcgis.com/ios/latest/swift/guide/display-scenes-in-augmented-reality.htm) [![world-scale sample](https://img.shields.io/badge/World_Scale-Sample-blue)](https://developers.arcgis.com/ios/latest/swift/sample-code/collect-data-in-ar/) [![Tabletop sample](https://img.shields.io/badge/Tabletop-Sample-blue)](https://developers.arcgis.com/ios/latest/swift/sample-code/display-scenes-in-tabletop-ar/) [![Flyover sample](https://img.shields.io/badge/Flyover-Sample-blue)](https://developers.arcgis.com/ios/latest/swift/sample-code/explore-scenes-in-flyover-ar/) +[![guide doc](https://img.shields.io/badge/Full_Developers_Guide-Doc-purple)](https://developers.arcgis.com/ios/scenes-3d/display-scenes-in-augmented-reality/) [![world-scale sample](https://img.shields.io/badge/World_Scale-Sample-blue)](https://developers.arcgis.com/ios/swift/sample-code/collect-data-in-ar/) [![Tabletop sample](https://img.shields.io/badge/Tabletop-Sample-blue)](https://developers.arcgis.com/ios/swift/sample-code/display-scenes-in-tabletop-ar/) [![Flyover sample](https://img.shields.io/badge/Flyover-Sample-blue)](https://developers.arcgis.com/ios/swift/sample-code/explore-scenes-in-flyover-ar/) Augmented reality experiences are designed to "augment" the physical world with virtual content that respects real world scale, position, and orientation of a device. In the case of Runtime, a SceneView displays 3D geographic data as virtual content on top of a camera feed which represents the real, physical world. diff --git a/Sources/ArcGISToolkit/JobManager.swift b/Sources/ArcGISToolkit/JobManager.swift index 6b27e82..fa29349 100644 --- a/Sources/ArcGISToolkit/JobManager.swift +++ b/Sources/ArcGISToolkit/JobManager.swift @@ -217,7 +217,7 @@ public class JobManager: NSObject { /// /// An `AGSJob`'s status is `.paused` when it is created from JSON. So any `AGSJob`s that have been reloaded from User Defaults will be in the `.paused` state. /// - /// See the [Tasks and Jobs](https://developers.arcgis.com/ios/latest/swift/guide/tasks-and-jobs.htm#ESRI_SECTION1_BA1D597878F049278CC787A1C04F9734) + /// See the [Tasks and Jobs](https://developers.arcgis.com/ios/programming-patterns/tasks-and-jobs/#pause-resume-or-cancel-a-job) /// guide topic for more details. /// /// - Parameters: @@ -251,7 +251,7 @@ public class JobManager: NSObject { /// /// This happens when the `JobManager` is initialized. All `AGSJob`s will be in the `.paused` state when first restored from JSON. /// - /// See the [Tasks and Jobs](https://developers.arcgis.com/ios/latest/swift/guide/tasks-and-jobs.htm#ESRI_SECTION1_BA1D597878F049278CC787A1C04F9734) + /// See the [Tasks and Jobs](https://developers.arcgis.com/ios/programming-patterns/tasks-and-jobs/#pause-resume-or-cancel-a-job) /// guide topic for more details. private func loadJobsFromUserDefaults() { if let storedJobsJSON = UserDefaults.standard.dictionary(forKey: jobsDefaultsKey) { From 7227b1dce1ae63f0c21de9b9500e28fc1c58c12b Mon Sep 17 00:00:00 2001 From: Mark Dostal Date: Tue, 3 Aug 2021 08:29:35 -0500 Subject: [PATCH 4/7] Update Sources/ArcGISToolkit/MeasureToolbar.swift Co-authored-by: Philip Ridgeway --- Sources/ArcGISToolkit/MeasureToolbar.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ArcGISToolkit/MeasureToolbar.swift b/Sources/ArcGISToolkit/MeasureToolbar.swift index 75c810b..164bfd5 100644 --- a/Sources/ArcGISToolkit/MeasureToolbar.swift +++ b/Sources/ArcGISToolkit/MeasureToolbar.swift @@ -689,7 +689,7 @@ public class MeasureToolbar: UIToolbar, AGSGeoViewTouchDelegate, UnitsViewContro } } - func topViewController(_ controller: UIViewController? = UIApplication.shared.windows.first(where: { $0.isKeyWindow })?.rootViewController) -> UIViewController? { + private func topViewController(_ controller: UIViewController? = UIApplication.shared.windows.first(where: { $0.isKeyWindow })?.rootViewController) -> UIViewController? { if let navigationController = controller as? UINavigationController { return topViewController(navigationController.visibleViewController) } From f4318312daec6128d6a4dd3b951c9581d5355eb8 Mon Sep 17 00:00:00 2001 From: Zachary Kline Date: Mon, 23 Aug 2021 14:51:00 -0700 Subject: [PATCH 5/7] Update Package.swift --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 4cc3fb7..5c18504 100644 --- a/Package.swift +++ b/Package.swift @@ -36,7 +36,7 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/Esri/arcgis-runtime-ios", .upToNextMinor(from: "100.11.0")) + .package(url: "https://github.com/Esri/arcgis-runtime-ios", .upToNextMinor(from: "100.12.0")) ], targets: [ .target( From c6d12ce67afc67357363135a4bcb7715fb4fd6b2 Mon Sep 17 00:00:00 2001 From: Mark Dostal Date: Mon, 23 Aug 2021 19:19:18 -0500 Subject: [PATCH 6/7] Update README.md Update readme for v100.12 --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bc8fdf7..87194af 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ To use Toolkit in your project: * **[TimeSlider](Documentation/TimeSlider)** - Allows interactively defining a temporal range (i.e. time extent) and animating time moving forward or backward. Can be used to manipulate the time extent in a MapView or SceneView. ## Requirements -* [ArcGIS Runtime SDK for iOS](https://developers.arcgis.com/ios/) 100.11.0 (or higher) +* [ArcGIS Runtime SDK for iOS](https://developers.arcgis.com/ios/) 100.12.0 (or higher) * Xcode 12.0 (or higher) The *ArcGIS Runtime Toolkit for iOS* has a *Target SDK* version of *13.0*, meaning that it can run on devices with *iOS 13.0* or newer. @@ -36,7 +36,7 @@ The *ArcGIS Runtime Toolkit for iOS* has a *Target SDK* version of *13.0*, meani 1. Open your project in Xcode 2. Go to *File* > *Swift Packages* > *Add Package Dependency* option 3. Enter `https://github.com/Esri/arcgis-runtime-toolkit-ios` as the package repository URL - 4. Choose version 100.11.0 or a later version. Click Next. Only version 100.11.0 or newer supports Swift Package Manager. + 4. Choose version 100.12.0 or a later version. Click Next. Note: The Toolkit Swift Package adds the ArcGIS SDK Swift Package as a dependency so no need to add both separately. If you already have the ArcGIS SDK Swift Package delete that and just add the Toolkit Swift Package. @@ -57,8 +57,6 @@ The *ArcGIS Runtime Toolkit for iOS* has a *Target SDK* version of *13.0*, meani 3. Add the *ArcGISToolkit* library in your app, by adding it to the Frameworks, Libraries, and Embedded Content section of the General pane for your app target. The *ArcGISToolkit* library contains the *ArcGIS Runtime SDK for iOS* library, so you don't need to add that separately. 4. Add `import ArcGIS` and `import ArcGISToolkit` in your source code and start using the toolkit components -Note: Support for Carthage has been dropped for v100.11.0. - ## SwiftLint Both the Toolkit and Examples app support SwiftLint. You can install SwiftLint from [here](https://github.com/realm/SwiftLint). It is not necessary to have it installed in order to build, but you will get a warning without it. The specific rules the linter uses can be found in the `swiftlint.yml` files in the `Toolkit` and `Examples` directories. From 5f699707b0f5451eee6d5a75a29efcd93fa20578 Mon Sep 17 00:00:00 2001 From: Mark Dostal Date: Tue, 24 Aug 2021 12:54:03 -0500 Subject: [PATCH 7/7] Update README.md re-add SPM version info --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 87194af..d97f948 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ The *ArcGIS Runtime Toolkit for iOS* has a *Target SDK* version of *13.0*, meani 1. Open your project in Xcode 2. Go to *File* > *Swift Packages* > *Add Package Dependency* option 3. Enter `https://github.com/Esri/arcgis-runtime-toolkit-ios` as the package repository URL - 4. Choose version 100.12.0 or a later version. Click Next. + 4. Choose version 100.12.0 or a later version. Click Next. Only version 100.11.0 or newer supports Swift Package Manager. Note: The Toolkit Swift Package adds the ArcGIS SDK Swift Package as a dependency so no need to add both separately. If you already have the ArcGIS SDK Swift Package delete that and just add the Toolkit Swift Package.