Skip to content

Commit de6ebdb

Browse files
authored
Merge pull request #158 from Esri/update12
Update12
2 parents 90db275 + e002437 commit de6ebdb

File tree

7 files changed

+27
-29
lines changed

7 files changed

+27
-29
lines changed

.swiftlint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,6 @@ disabled_rules:
6363

6464
trailing_whitespace:
6565
ignores_empty_lines: true
66+
67+
excluded:
68+
- Pods

Documentation/AR/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Augmented reality (AR)
22

3-
[![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/)
3+
[![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/)
44

55
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.
66

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ let package = Package(
3636
)
3737
],
3838
dependencies: [
39-
.package(url: "https://github.com/Esri/arcgis-runtime-ios", .upToNextMinor(from: "100.11.0"))
39+
.package(url: "https://github.com/Esri/arcgis-runtime-ios", .upToNextMinor(from: "100.12.0"))
4040
],
4141
targets: [
4242
.target(

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ To use Toolkit in your project:
2424
* **[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.
2525

2626
## Requirements
27-
* [ArcGIS Runtime SDK for iOS](https://developers.arcgis.com/ios/) 100.11.0 (or higher)
27+
* [ArcGIS Runtime SDK for iOS](https://developers.arcgis.com/ios/) 100.12.0 (or higher)
2828
* Xcode 12.0 (or higher)
2929

3030
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
3636
1. Open your project in Xcode
3737
2. Go to *File* > *Swift Packages* > *Add Package Dependency* option
3838
3. Enter `https://github.com/Esri/arcgis-runtime-toolkit-ios` as the package repository URL
39-
4. Choose version 100.11.0 or a later version. Click Next. Only version 100.11.0 or newer supports Swift Package Manager.
39+
4. Choose version 100.12.0 or a later version. Click Next. Only version 100.11.0 or newer supports Swift Package Manager.
4040

4141
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.
4242

@@ -57,8 +57,6 @@ The *ArcGIS Runtime Toolkit for iOS* has a *Target SDK* version of *13.0*, meani
5757
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.
5858
4. Add `import ArcGIS` and `import ArcGISToolkit` in your source code and start using the toolkit components
5959

60-
Note: Support for Carthage has been dropped for v100.11.0.
61-
6260
## SwiftLint
6361

6462
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.

Sources/ArcGISToolkit/Extensions.swift

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,6 @@
1414
import Foundation
1515
import UIKit
1616

17-
extension UIApplication {
18-
func topViewController(_ controller: UIViewController? = UIApplication.shared.windows.first(where: { $0.isKeyWindow })?.rootViewController) -> UIViewController? {
19-
if let navigationController = controller as? UINavigationController {
20-
return topViewController(navigationController.visibleViewController)
21-
}
22-
if let tabController = controller as? UITabBarController {
23-
if let selected = tabController.selectedViewController {
24-
return topViewController(selected)
25-
}
26-
}
27-
if let presented = controller?.presentedViewController {
28-
return topViewController(presented)
29-
}
30-
return controller
31-
}
32-
}
33-
3417
#if !SWIFT_PACKAGE
3518
// This is a workaround for cocoapods compatibility.
3619
extension Bundle {

Sources/ArcGISToolkit/JobManager.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public class JobManager: NSObject {
217217
///
218218
/// 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.
219219
///
220-
/// See the [Tasks and Jobs](https://developers.arcgis.com/ios/latest/swift/guide/tasks-and-jobs.htm#ESRI_SECTION1_BA1D597878F049278CC787A1C04F9734)
220+
/// See the [Tasks and Jobs](https://developers.arcgis.com/ios/programming-patterns/tasks-and-jobs/#pause-resume-or-cancel-a-job)
221221
/// guide topic for more details.
222222
///
223223
/// - Parameters:
@@ -251,7 +251,7 @@ public class JobManager: NSObject {
251251
///
252252
/// This happens when the `JobManager` is initialized. All `AGSJob`s will be in the `.paused` state when first restored from JSON.
253253
///
254-
/// See the [Tasks and Jobs](https://developers.arcgis.com/ios/latest/swift/guide/tasks-and-jobs.htm#ESRI_SECTION1_BA1D597878F049278CC787A1C04F9734)
254+
/// See the [Tasks and Jobs](https://developers.arcgis.com/ios/programming-patterns/tasks-and-jobs/#pause-resume-or-cancel-a-job)
255255
/// guide topic for more details.
256256
private func loadJobsFromUserDefaults() {
257257
if let storedJobsJSON = UserDefaults.standard.dictionary(forKey: jobsDefaultsKey) {

Sources/ArcGISToolkit/MeasureToolbar.swift

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ private enum MeasureToolbarMode {
159159
case feature
160160
}
161161

162-
public class MeasureToolbar: UIToolbar, AGSGeoViewTouchDelegate {
162+
@available(iOSApplicationExtension, unavailable)
163+
public class MeasureToolbar: UIToolbar, AGSGeoViewTouchDelegate, UnitsViewControllerDelegate {
163164
// Exposed so that the user can customize the sketch editor styles.
164165
// Consumers of the MeasureToolbar should not mutate the sketch editor state
165166
// other than it's style.
@@ -462,7 +463,7 @@ public class MeasureToolbar: UIToolbar, AGSGeoViewTouchDelegate {
462463
let navigationController = UINavigationController(rootViewController: unitsViewController)
463464
navigationController.modalPresentationStyle = .formSheet
464465

465-
UIApplication.shared.topViewController()?.present(navigationController, animated: true)
466+
topViewController()?.present(navigationController, animated: true)
466467
}
467468

468469
/// Called in response to
@@ -671,9 +672,7 @@ public class MeasureToolbar: UIToolbar, AGSGeoViewTouchDelegate {
671672
}
672673
return nil
673674
}
674-
}
675675

676-
extension MeasureToolbar: UnitsViewControllerDelegate {
677676
public func unitsViewControllerDidCancel(_ unitsViewController: UnitsViewController) {
678677
unitsViewController.dismiss(animated: true)
679678
}
@@ -689,4 +688,19 @@ extension MeasureToolbar: UnitsViewControllerDelegate {
689688
fatalError("Unsupported unit type")
690689
}
691690
}
691+
692+
private func topViewController(_ controller: UIViewController? = UIApplication.shared.windows.first(where: { $0.isKeyWindow })?.rootViewController) -> UIViewController? {
693+
if let navigationController = controller as? UINavigationController {
694+
return topViewController(navigationController.visibleViewController)
695+
}
696+
if let tabController = controller as? UITabBarController {
697+
if let selected = tabController.selectedViewController {
698+
return topViewController(selected)
699+
}
700+
}
701+
if let presented = controller?.presentedViewController {
702+
return topViewController(presented)
703+
}
704+
return controller
705+
}
692706
}

0 commit comments

Comments
 (0)