-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from Esri/v.next
2.0.4 Release -> U11 Certification
- Loading branch information
Showing
35 changed files
with
300 additions
and
1,482 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule arcgis-runtime-toolkit-ios
deleted from
5f1e65
Large diffs are not rendered by default.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
mapbook-iOS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"object": { | ||
"pins": [ | ||
{ | ||
"package": "arcgis-runtime-ios", | ||
"repositoryURL": "https://github.com/Esri/arcgis-runtime-ios", | ||
"state": { | ||
"branch": null, | ||
"revision": "2e3b263a608e1fb2ba75519cacd341cfc4e7e4f0", | ||
"version": "100.11.0" | ||
} | ||
}, | ||
{ | ||
"package": "arcgis-runtime-toolkit-ios", | ||
"repositoryURL": "https://github.com/Esri/arcgis-runtime-toolkit-ios", | ||
"state": { | ||
"branch": null, | ||
"revision": "90db275566467878e9dd13e4cf15302d99300483", | ||
"version": "100.11.0" | ||
} | ||
} | ||
] | ||
}, | ||
"version": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
// Copyright 2021 Esri | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
import UIKit | ||
|
||
extension UIViewController: GlobalProgressDisplayable { | ||
var window: UIWindow? { view.window } | ||
} | ||
|
||
extension UIApplication: GlobalProgressDisplayable { | ||
var window: UIWindow? { windows.first } | ||
} | ||
|
||
protocol GlobalProgressDisplayable { | ||
var window: UIWindow? { get } | ||
} | ||
|
||
extension GlobalProgressDisplayable { | ||
func showProgress(_ message: String) { | ||
GlobalProgress.shared.showProgress(message, duration: nil, window: window, animated: true) | ||
} | ||
func showError(_ error: Error, duration: TimeInterval = 2.0) { | ||
GlobalProgress.shared.showProgress(error.localizedDescription, duration: duration, window: window, animated: false) | ||
} | ||
func hideProgress() { | ||
GlobalProgress.shared.hideProgress() | ||
} | ||
} | ||
|
||
private class GlobalProgress { | ||
|
||
static let shared = GlobalProgress() | ||
|
||
private init() { } | ||
|
||
private var alertWindow: UIWindow? | ||
|
||
private var timer: Timer? | ||
|
||
func showProgress(_ message: String, duration: TimeInterval?, window: UIWindow?, animated: Bool) { | ||
// Invalidate old timer, if one exists | ||
timer?.invalidate() | ||
timer = nil | ||
// Update existing progress if already presented | ||
if let alertWindow = alertWindow { | ||
(alertWindow.rootViewController as! PhantomViewController).progress.label.text = message | ||
} else { | ||
let progressWindow = UIWindow(frame: window?.frame ?? UIScreen.main.bounds) | ||
let progress = ProgressViewController() | ||
progress.loadViewIfNeeded() | ||
progress.label.text = message | ||
let phantom = PhantomViewController(progress) | ||
progressWindow.rootViewController = phantom | ||
progressWindow.windowLevel = .alert + 1 | ||
progressWindow.makeKeyAndVisible() | ||
alertWindow = progressWindow | ||
} | ||
// Create a timer to dismiss if a duration is set | ||
if let duration = duration { | ||
timer = Timer.scheduledTimer( | ||
timeInterval: duration, | ||
target: self, | ||
selector: #selector(hideProgress), | ||
userInfo: nil, | ||
repeats: false | ||
) | ||
} | ||
} | ||
|
||
@objc | ||
func hideProgress() { | ||
guard let window = alertWindow, | ||
let phantom = window.rootViewController as? PhantomViewController | ||
else { return } | ||
|
||
phantom.progress.dismiss(animated: true) { | ||
self.alertWindow?.resignKey() | ||
self.alertWindow = nil | ||
} | ||
} | ||
} | ||
|
||
fileprivate class ProgressViewController: UIViewController { | ||
|
||
@IBOutlet weak var label: UILabel! | ||
@IBOutlet weak var activityView: UIActivityIndicatorView! | ||
|
||
init() { | ||
super.init(nibName: "ProgressViewController", bundle: Bundle.main) | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
super.init(coder: coder) | ||
} | ||
|
||
override var prefersStatusBarHidden: Bool { | ||
false | ||
} | ||
} | ||
|
||
fileprivate class PhantomViewController: UIViewController { | ||
|
||
let progress: ProgressViewController | ||
|
||
// MARK: - Init | ||
|
||
init(_ progress: ProgressViewController) { | ||
self.progress = progress | ||
super.init(nibName: nil, bundle: nil) | ||
} | ||
|
||
required init?(coder aDecoder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
// MARK: - Lifecycle | ||
|
||
override func viewDidAppear(_ animated: Bool) { | ||
super.viewDidAppear(animated) | ||
progress.modalTransitionStyle = .crossDissolve | ||
progress.modalPresentationStyle = .overFullScreen | ||
present(progress, animated: true, completion: nil) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> | ||
<device id="retina6_1" orientation="portrait" appearance="light"/> | ||
<dependencies> | ||
<deployment identifier="iOS"/> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17505"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<objects> | ||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ProgressViewController" customModule="mapbook_iOS" customModuleProvider="target"> | ||
<connections> | ||
<outlet property="activityView" destination="fuJ-0p-PJT" id="nm1-El-hjq"/> | ||
<outlet property="label" destination="XQR-fN-MRY" id="fVR-4w-y1Z"/> | ||
<outlet property="view" destination="iN0-l3-epB" id="PXs-FC-G7m"/> | ||
</connections> | ||
</placeholder> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | ||
<view contentMode="scaleToFill" id="iN0-l3-epB"> | ||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<subviews> | ||
<visualEffectView opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3mk-xg-GVK"> | ||
<rect key="frame" x="88" y="389.5" width="238" height="127"/> | ||
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" id="tiG-wt-R88"> | ||
<rect key="frame" x="0.0" y="0.0" width="238" height="127"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<subviews> | ||
<stackView opaque="NO" contentMode="scaleToFill" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="R2o-b6-Ljz"> | ||
<rect key="frame" x="16" y="16" width="206.5" height="95.5"/> | ||
<subviews> | ||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="1K4-en-qgj"> | ||
<rect key="frame" x="0.0" y="0.0" width="206.5" height="95.5"/> | ||
<subviews> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="1000" text="Presenting status of long-running process" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="4" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XQR-fN-MRY"> | ||
<rect key="frame" x="0.0" y="0.0" width="206.5" height="42.5"/> | ||
<fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/> | ||
<nil key="textColor"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
<activityIndicatorView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" animating="YES" style="large" translatesAutoresizingMaskIntoConstraints="NO" id="fuJ-0p-PJT"> | ||
<rect key="frame" x="0.0" y="58.5" width="206.5" height="37"/> | ||
</activityIndicatorView> | ||
</subviews> | ||
</stackView> | ||
</subviews> | ||
</stackView> | ||
</subviews> | ||
<constraints> | ||
<constraint firstAttribute="trailing" secondItem="R2o-b6-Ljz" secondAttribute="trailing" constant="16" id="PwF-za-IED"/> | ||
<constraint firstAttribute="bottom" secondItem="R2o-b6-Ljz" secondAttribute="bottom" constant="16" id="Qsb-Vg-aCq"/> | ||
<constraint firstItem="R2o-b6-Ljz" firstAttribute="top" secondItem="tiG-wt-R88" secondAttribute="top" constant="16" id="Y2d-Q6-BI6"/> | ||
<constraint firstItem="R2o-b6-Ljz" firstAttribute="leading" secondItem="tiG-wt-R88" secondAttribute="leading" constant="16" id="z8T-qc-pYE"/> | ||
</constraints> | ||
</view> | ||
<constraints> | ||
<constraint firstAttribute="height" relation="lessThanOrEqual" constant="300" id="spP-vp-Yw1"/> | ||
<constraint firstAttribute="width" relation="lessThanOrEqual" constant="300" id="tbj-N9-j1G"/> | ||
</constraints> | ||
<blurEffect style="systemThickMaterial"/> | ||
<userDefinedRuntimeAttributes> | ||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius"> | ||
<integer key="value" value="8"/> | ||
</userDefinedRuntimeAttribute> | ||
</userDefinedRuntimeAttributes> | ||
</visualEffectView> | ||
</subviews> | ||
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/> | ||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
<constraints> | ||
<constraint firstItem="3mk-xg-GVK" firstAttribute="centerY" secondItem="vUN-kp-3ea" secondAttribute="centerY" id="GBr-Tb-vn8"/> | ||
<constraint firstItem="3mk-xg-GVK" firstAttribute="centerX" secondItem="vUN-kp-3ea" secondAttribute="centerX" id="no0-tm-KtD"/> | ||
</constraints> | ||
<point key="canvasLocation" x="137.68115942028987" y="129.91071428571428"/> | ||
</view> | ||
</objects> | ||
</document> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.