Skip to content

Commit

Permalink
Merge pull request #115 from Esri/v.next
Browse files Browse the repository at this point in the history
2.0.4 Release -> U11 Certification
  • Loading branch information
esreli authored Apr 26, 2021
2 parents e181930 + 2f1ba59 commit 895fcf1
Show file tree
Hide file tree
Showing 35 changed files with 300 additions and 1,482 deletions.
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Learn more about the App Architecture and usage [here](/docs/README.md).

**Note:** Starting from the 100.8 release, the ArcGIS Runtime SDK for iOS uses Apple's Metal framework to display maps and scenes. However, Xcode does not support Metal based rendering in any version of iOS simulator on macOS Mojave. If you are developing map or scene based apps in these environments, you will need test and debug them on a physical device instead of the simulator.

**Note:** The 100.10 release of the ArcGIS Runtime SDK for iOS replaces the installed "fat framework" `ArcGIS.framework` with a new binary framework `ArcGIS.xcframework`. It also changes the location of the installed framework file and removes the need for the `strip-frameworks.sh` Build Phase. These changes have been incorporated in the lastest release of *Mapbook iOS*.
**Note:** The 100.10 release of the ArcGIS Runtime SDK for iOS replaces the installed "fat framework" `ArcGIS.framework` with a new binary framework `ArcGIS.xcframework`. It also changes the location of the installed framework file and removes the need for the `strip-frameworks.sh` Build Phase. These changes have been incorporated in the latest release of *Mapbook iOS*.

## Contributing
Anyone and everyone is welcome to [contribute](CONTRIBUTING.md). We do accept pull requests.
Expand Down
7 changes: 7 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v2.0.4

- Certification for the 100.11.0 release of the ArcGIS Runtime SDK for iOS.
- Removes now-unused app delegate method.
- Introduces `ArcGIS` and `ArcGISToolkit` as Swift Package Manager dependencies.
- Swaps `PKHUD` for OSA home-baked `ProgressViewController`.

# v2.0.3

- The 100.10.0 release of the ArcGIS Runtime for iOS is now distributed as a binary framework. This necessitated the following changes in the Mapbook Xcode project file:
Expand Down
1 change: 0 additions & 1 deletion arcgis-runtime-toolkit-ios
Submodule arcgis-runtime-toolkit-ios deleted from 5f1e65
219 changes: 53 additions & 166 deletions mapbook-iOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

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
}
25 changes: 2 additions & 23 deletions mapbook-iOS/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {

if let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false),
urlComponents.scheme == AppSettings.appSchema, urlComponents.host == AppSettings.authURLPath {

AGSApplicationDelegate.shared().application(app, open: url, options: options)
}
return true
}

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

setLicenseKey()
setupOAuthManager()
modifyAppearance()
configureHUD()

return true
}

Expand Down Expand Up @@ -105,18 +92,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = .primary
}

// MARK:- Configure HUD (PKHUD)

func configureHUD() {
HUD.registerForKeyboardNotifications()
HUD.dimsBackground = false
HUD.allowsInteraction = false
}
}

func flash(error: Error, delay: TimeInterval = 2.0) {
HUD.flash(.labeledError(title: nil, subtitle: error.localizedDescription), delay: delay)
func flash(error: Error, duration: TimeInterval = 2.0) {
UIApplication.shared.showError(error, duration: duration)
}

func state(error: Error, in controller: UIViewController) {
Expand Down
135 changes: 135 additions & 0 deletions mapbook-iOS/HUD/ProgressViewController.swift
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)
}
}
77 changes: 77 additions & 0 deletions mapbook-iOS/HUD/ProgressViewController.xib
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>
67 changes: 0 additions & 67 deletions mapbook-iOS/PKHUD/FrameView.swift

This file was deleted.

Loading

0 comments on commit 895fcf1

Please sign in to comment.