Skip to content

Commit

Permalink
Merge pull request #232 from Esri/v.next
Browse files Browse the repository at this point in the history
Release version 1.2.0
  • Loading branch information
mhdostal authored May 29, 2020
2 parents 666b5b1 + 728bd85 commit 579b11d
Show file tree
Hide file tree
Showing 57 changed files with 1,682 additions and 426 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "arcgis-runtime-toolkit-ios"]
path = arcgis-runtime-toolkit-ios
url = https://github.com/Esri/arcgis-runtime-toolkit-ios
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[Data Collection for iOS](https://developers.arcgis.com/example-apps/data-collection-ios/) shows how a robust application can be built around the ArcGIS Platform using the ArcGIS Runtime SDK for iOS and Swift. It demonstrates best practices around some simple but key functionality of the ArcGIS Runtime. Using your organization's web maps, you can use Data Collection as is, or extend it to meet your specific needs.

![General UI](./docs/images/General-UI.png)
![General UI 2](./docs/images/General-UI-2.png)

## Features
* Taking your web map and data offline
Expand All @@ -26,14 +27,24 @@ The project also demonstrates some patterns for building real-world apps around
* Swift KVO & NotificationCenter state handling

## Get Started
You will need [Xcode 11](https://itunes.apple.com/us/app/xcode/id497799835?mt=12) and the [ArcGIS Runtime SDK](https://developers.arcgis.com/ios/latest/swift/guide/install.htm#ESRI_SECTION1_D57435A2BEBC4D29AFA3A4CAA722506A) (v100.5 or later) installed locally.
You will need [Xcode 11](https://itunes.apple.com/us/app/xcode/id497799835?mt=12) and the [ArcGIS Runtime SDK for iOS](https://developers.arcgis.com/ios/latest/swift/guide/install.htm#ESRI_SECTION1_D57435A2BEBC4D29AFA3A4CAA722506A) (v100.8 or later) installed locally.

The *Data Collection app* now incorporates the [ArcGIS Runtime Toolkit for iOS](https://github.com/Esri/arcgis-runtime-toolkit-ios) (v100.8 or later) for additional functionality.

### Fork the repo
**Fork** the [Data Collection](https://github.com/Esri/data-collection-ios/fork) repo

### Clone the repo
Once you have forked the repo, you can make a clone and open `data-collection.xcodeproj` in Xcode.

> Make sure to use the "recursive" option to ensure you get the **ArcGIS Runtime Toolkit** submodule
>
>`git clone --recursive [URL to forked Git repo]`
>
> If you've already cloned the repo without the submodule, you can load the submodule using
>
>`git submodule update --init`
#### Command line Git
1. [Clone Data Collection](https://help.github.com/articles/fork-a-repo/#step-2-create-a-local-clone-of-your-fork)
2. `cd` into into the cloned repository's directory
Expand Down Expand Up @@ -96,6 +107,8 @@ Learn more about Esri open source apps [here](https://developers.arcgis.com/exam
* To edit records or take a web map offline you will need an ArcGIS Online Organizational account, an ArcGIS Online Developer account or an ArcGIS Online account authenticated using a social login.
* To consume your own web map you will need an ArcGIS Online Organizational account.

**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 iOS 12 simulators on macOS Catalina, or 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.

## Contributing
Anyone and everyone is welcome to [contribute](CONTRIBUTING.md). We do accept pull requests.

Expand Down
12 changes: 12 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Release 1.2.0

- Adds an "Extras" button containing "Bookmarks" and "Layers" options:
- Bookmarks: users can select from a list of web map-defined bookmarks to easily navigate their map.
- Layers: users can view the layers and symbology in their map and turn the display of layers on and off.
- Incorporate the [ArcGIS Runtime Toolkit for iOS](https://github.com/Esri/arcgis-runtime-toolkit-ios) as a git submodule to provide the BookmarksViewController component.
- Improves some organization of the code.
- Fix build-time warning when building with XCode 11.4 (in LoadableErrors.swift).
- Adds Alamofire dependency as a Swift Package. Updates using the latest `NetworkReachabilityManager` API.
- Improves how the app maintains static configurations.
- Certification for the 100.8.0 release of the ArcGIS Runtime SDK for iOS.

# Release 1.1.4

- Fixes featureLayer deprecation.
Expand Down
1 change: 1 addition & 0 deletions arcgis-runtime-toolkit-ios
186 changes: 148 additions & 38 deletions data-collection/data-collection.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"object": {
"pins": [
{
"package": "Alamofire",
"repositoryURL": "https://github.com/Alamofire/Alamofire",
"state": {
"branch": null,
"revision": "2777659076fda38bd4e487739ee331c7a65b5924",
"version": "5.2.1"
}
}
]
},
"version": 1
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extension AppContext {
/// - Note: The ArcGIS Runtime SDK will present a modal sign-in web view if it cannot find any suitable cached credentials.
func signIn() {
// Setting `loginRequired` to `true` will force a sign-in prompt to present.
portal = AppConfiguration.buildConfiguredPortal(loginRequired: true)
portal = AGSPortal.configuredPortal(loginRequired: true)
}

/// Log out in the app and from the portal.
Expand All @@ -57,6 +57,6 @@ extension AppContext {
// We want to remove cached credentials from geo-coder services, in case they are cached.
appReverseGeocoder.removeCredentialsFromServices()
// Setting `loginRequired` to `false` will allow unauthenticated users to consume the map (but not edit!)
portal = AppConfiguration.buildConfiguredPortal(loginRequired: false)
portal = AGSPortal.configuredPortal(loginRequired: false)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import ArcGIS

extension AppContext {

private var visibleAreaDefaultsKey: String { return "VisibleAreaDefaultsKey.\(AppConfiguration.webMapItemID)" }
private var visibleAreaDefaultsKey: String { return "VisibleAreaDefaultsKey.\(String.webMapItemID)" }

/// The shared visible area `AGSViewpoint`.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ enum WorkMode: Int {
case online = 1
case offline

private static let userDefaultsKey = "WorkMode.\(AppConfiguration.webMapItemID)"
private static let userDefaultsKey = "WorkMode.\(String.webMapItemID)"

func storeDefaultWorkMode() {
UserDefaults.standard.set(self.rawValue, forKey: WorkMode.userDefaultsKey)
Expand Down Expand Up @@ -75,8 +75,10 @@ extension AppContext {
/// Load the downloaded `AGSMobileMapPackage` if possible, setting the kv-observable `hasOfflineMap` boolean property and returning an AGSMap.
private func loadOfflineMobileMapPackage(_ completion: @escaping (AGSMap?) -> Void) {

self.mobileMapPackage = LastSyncMobileMapPackage(fileURL: .offlineMapDirectoryURL(forWebMapItemID: AppConfiguration.webMapItemID),
userDefaultsKey: "LastSyncMobileMapPackage.\(AppConfiguration.webMapItemID)")
self.mobileMapPackage = LastSyncMobileMapPackage(
fileURL: .offlineMapDirectoryURL(forWebMapItemID: .webMapItemID),
userDefaultsKey: String(format: "LastSyncMobileMapPackage.%@", String.webMapItemID)
)

guard let mmpk = self.mobileMapPackage else {
hasOfflineMap = false
Expand Down Expand Up @@ -129,7 +131,10 @@ extension AppContext {

@discardableResult
func moveDownloadedMapToOfflineMapDirectory() throws -> URL? {
return try FileManager.default.replaceItemAt(.offlineMapDirectoryURL(forWebMapItemID: AppConfiguration.webMapItemID), withItemAt: .temporaryOfflineMapDirectoryURL(forWebMapItemID: AppConfiguration.webMapItemID))
return try FileManager.default.replaceItemAt(
.offlineMapDirectoryURL(forWebMapItemID: .webMapItemID),
withItemAt: .temporaryOfflineMapDirectoryURL(forWebMapItemID: .webMapItemID)
)
}


Expand Down Expand Up @@ -162,8 +167,10 @@ extension AppContext {

/// Open a web map stored in the portal. Set it to the current map and the work mode to online.
func setWorkModeOnlineWithMapFromPortal() {

let portalItem = AGSPortalItem(portal: portal, itemID: AppConfiguration.webMapItemID)
let portalItem = AGSPortalItem(
portal: portal,
itemID: .webMapItemID
)
let map = AGSMap(item: portalItem)
set(onlineMap: map)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import ArcGIS
///
/// When set, the portal is configured for OAuth authentication so that if login is required,
/// the Runtime SDK and iOS can work together to authenticate the current user.
var portal:AGSPortal = AppConfiguration.buildConfiguredPortal(loginRequired: false) {
var portal:AGSPortal = AGSPortal.configuredPortal(loginRequired: false) {
didSet {
portal.load { [weak self] (error: Error?) in

Expand Down
Loading

0 comments on commit 579b11d

Please sign in to comment.