Skip to content

Commit 5992329

Browse files
authored
Merge pull request #97 from Esri/v.next
[Release] 200.0.0-beta
2 parents 155f56d + 2bcd753 commit 5992329

File tree

188 files changed

+11187
-13
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+11187
-13
lines changed

.github/workflows/main.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# The name of the job, which will be displayed for the status check in PR.
2+
name: README and metadata formatting
3+
4+
# Controls when the action will run.
5+
# Below triggers the workflow on pull requests to `main` or `v.next` branch.
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
- v.next
11+
12+
# A workflow run is made up of one or more jobs that can run sequentially or
13+
# in parallel.
14+
jobs:
15+
# This workflow contains a single job called "changes"
16+
changes:
17+
name: Check README and metadata format for changed files
18+
19+
# Comment out the line below if the job is only running for certain labels.
20+
# i.e. only run the job on PRs with label "new-sample"
21+
22+
# if: contains(github.event.pull_request.labels.*.name, 'new-sample')
23+
24+
# The type of runner that the job will run on
25+
# supported VMs are here: https://docs.github.com/en/free-pro-team@latest/actions/reference/specifications-for-github-hosted-runners#supported-runners-and-hardware-resources
26+
runs-on: ubuntu-latest
27+
28+
# Steps represent a sequence of tasks that got executed as part of the job.
29+
steps:
30+
31+
# This step gets the paths to all changed files and returns an array
32+
# such as ['xxx/README.md', 'xxx/README.metadata.json', 'xxx/1.png']
33+
# https://github.com/trilom/file-changes-action
34+
- id: file_changes
35+
name: Detect changed file paths
36+
uses: trilom/file-changes-action@master
37+
38+
# Checks-out your repository under $GITHUB_WORKSPACE, so the workflow can
39+
# access the files.
40+
# https://github.com/actions/checkout
41+
- name: Checkout the repository
42+
uses: actions/checkout@v2
43+
44+
# Print out changed file paths for debugging purposes.
45+
- name: Print changed file paths
46+
run: |
47+
echo 'Below shows a list of changed file paths'
48+
echo '${{ steps.file_changes.outputs.files}}'
49+
# echo '${{ steps.file_changes.outputs.files_modified}}'
50+
# echo '${{ steps.file_changes.outputs.files_added}}'
51+
# echo '${{ steps.file_changes.outputs.files_removed}}'
52+
53+
- name: Run CI (currently only style checks)
54+
uses: ./Scripts/CI
55+
with:
56+
FILE_PATHS: ${{ steps.file_changes.outputs.files }}
57+
58+
# Runs a single command using the runners shell
59+
# - name: Run a script with Python
60+
# run: python ./Scripts/README-formatter.py

.gitignore

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
# App Secrets
2-
#
1+
## App Secrets
32
.secrets
43

5-
# Xcode
6-
#
7-
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
8-
94
## Build generated
105
build/
116
DerivedData/
@@ -30,10 +25,14 @@ xcuserdata/
3025
*.xcscmblueprint
3126

3227
## Portal Item Data
33-
/Portal\ Data
28+
Portal\ Data/
3429

3530
## Swift Package Manager
3631
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
3732
Packages/
3833
Package.pins
3934
Package.resolved
35+
36+
## Python build artifact
37+
# If the style check scripts are run locally, ignore the script build artifact.
38+
Scripts/CI/__pycache__/

.swiftlint.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
custom_rules:
2+
spatial_reference_web_mercator:
3+
name: Web Mercator Spatial Reference
4+
regex: SpatialReference\(wkid:\s*(3857|102100)\)
5+
message: "Use 'SpatialReference.webMercator' instead."
6+
spatial_reference_wgs84:
7+
name: WGS84 Spatial Reference
8+
regex: SpatialReference\(wkid:\s*(4326)\)
9+
message: "Use 'SpatialReference.wgs84' instead."
10+
simple_closure:
11+
name: Simple Closure
12+
regex: (-> Void in)|(\(\) in)
13+
message: "Void return and empty arguments should be avoided in closures."
14+
closure_opening_space:
15+
name: Closure Opening Space
16+
regex: \{\[|\{\s{2,}\[
17+
message: "Use one space between the brace and bracket."
18+
19+
# Rule identifiers to exclude from running
20+
disabled_rules:
21+
- file_length
22+
- for_where
23+
- force_cast
24+
- line_length
25+
- notification_center_detachment
26+
- type_body_length
27+
- type_name
28+
29+
# Some rules are only opt-in
30+
opt_in_rules:
31+
- anyobject_protocol
32+
- array_init
33+
- attributes
34+
- closure_end_indentation
35+
- closure_spacing
36+
- collection_alignment
37+
- contains_over_first_not_nil
38+
- convenience_type
39+
- discouraged_direct_init
40+
- discouraged_optional_boolean
41+
- empty_count
42+
- empty_string
43+
- empty_xctest_method
44+
- explicit_init
45+
- extension_access_modifier
46+
- fatal_error_message
47+
- first_where
48+
- function_default_parameter_at_end
49+
- identical_operands
50+
- joined_default_parameter
51+
- legacy_random
52+
- let_var_whitespace
53+
- literal_expression_end_indentation
54+
- lower_acl_than_parent
55+
- missing_docs
56+
- modifier_order
57+
- multiline_arguments
58+
- multiline_function_chains
59+
- multiline_parameters
60+
- operator_usage_whitespace
61+
- operator_whitespace
62+
- overridden_super_call
63+
- override_in_extension
64+
- prohibited_super_call
65+
- redundant_nil_coalescing
66+
- redundant_type_annotation
67+
- sorted_first_last
68+
- static_operator
69+
- toggle_bool
70+
- trailing_closure
71+
- untyped_error_in_catch
72+
- vertical_parameter_alignment_on_call
73+
- vertical_whitespace_closing_braces
74+
- vertical_whitespace_opening_braces
75+
- yoda_condition
76+
77+
identifier_name:
78+
min_length:
79+
# Do not flag short identifiers
80+
warning: 0
81+
trailing_closure:
82+
only_single_muted_parameter: true
83+
trailing_whitespace:
84+
ignores_empty_lines: true
85+
multiline_arguments:
86+
only_enforce_after_first_closure_on_first_line: true
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Configure App Secrets
2+
3+
As a best-practice principle, the project conceals app secrets from source code by generating and compiling an `AppSecrets.swift` source code file at build time using a custom build rule.
4+
5+
This build rule looks for a secrets file stored in the project's root directory, `$(SRCROOT)/.secrets`.
6+
7+
Note: License keys are not required for development. Without licensing or licensing with invalid keys do not throw an exception, but simply fail to license the app, falling back to Developer Mode (which will display a watermark on the map and scene views). Apply the license keys when the app is ready for deployment.
8+
9+
1. Create a hidden secrets file in the project's root directory.
10+
11+
```sh
12+
touch .secrets
13+
```
14+
15+
2. Add your **License Key** to the secrets file. Licensing the app will remove the 'Licensed for Developer Use Only' watermark. Licensing the app is optional in development but required for production. Add your **Extension License Key** and **API Key** to the secrets file if needed. Acquire license keys from your [dashboard](https://developers.arcgis.com/dashboard).
16+
17+
```sh
18+
echo ARCGIS_LICENSE_KEY=your-license-key >> .secrets
19+
echo ARCGIS_EXTENSION_LICENSE_KEY=your-extension-license-key >> .secrets
20+
echo ARCGIS_API_KEY_IOS=your-api-key >> .secrets
21+
```
22+
23+
> Replace 'your-license-key', 'your-extension-license-key' and 'your-api-key' with your keys.
24+
25+
Visit the developer's website to learn more about [Deployment](https://developers.arcgis.com/documentation/mapping-apis-and-services/deployment/) and [Security and authentication](https://developers.arcgis.com/documentation/mapping-apis-and-services/security/).
26+
27+
To learn more about `masquerade`, consult the [documentation](https://github.com/Esri/data-collection-ios/tree/main/docs#masquerade) of Esri's Data Collection app.

LICENSE

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
Apache License
1+
2+
Apache License
23
Version 2.0, January 2004
34
http://www.apache.org/licenses/
45

@@ -178,15 +179,15 @@ Apache License
178179
APPENDIX: How to apply the Apache License to your work.
179180

180181
To apply the Apache License to your work, attach the following
181-
boilerplate notice, with the fields enclosed by brackets "{}"
182+
boilerplate notice, with the fields enclosed by brackets "[]"
182183
replaced with your own identifying information. (Don't include
183184
the brackets!) The text should be enclosed in the appropriate
184185
comment syntax for the file format. We also recommend that a
185186
file or class name and description of purpose be included on the
186187
same "printed page" as the copyright notice for easier
187188
identification within third-party archives.
188189

189-
Copyright 2014 Esri
190+
Copyright 2022 Esri
190191

191192
Licensed under the Apache License, Version 2.0 (the "License");
192193
you may not use this file except in compliance with the License.
@@ -198,4 +199,4 @@ Apache License
198199
distributed under the License is distributed on an "AS IS" BASIS,
199200
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200201
See the License for the specific language governing permissions and
201-
limitations under the License.
202+
limitations under the License.

README.md

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,56 @@
1-
# ArcGIS Runtime SDK for Swift Samples
1+
# ArcGIS Maps SDK for Swift Samples
2+
3+
This repository contains Swift sample code demonstrating the capabilities of [ArcGIS Maps SDK for Swift](https://developers.arcgis.com/swift/) and how to use them in your own app. The project can be opened in Xcode and run on a simulator or a device.
4+
5+
## Requirements
6+
7+
* [ArcGIS Maps SDK for Swift](https://developers.arcgis.com/swift/) 200.0 (or newer)
8+
* [ArcGIS Maps SDK for Swift Toolkit](https://github.com/Esri/arcgis-maps-sdk-swift-toolkit) 200.0 (or newer)
9+
* Xcode 14.0 (or newer)
10+
11+
The *ArcGIS Maps SDK for Swift Samples app* has a *Target SDK* version of *15.0*, meaning that it can run on devices with *iOS 15.0* or newer.
12+
13+
## Building Samples Using Swift Package Manager
14+
15+
1. **Fork** and then **clone** the repository
16+
1. **Open** the `Samples.xcodeproj` **project** file
17+
> The project has been configured to use the arcgis-maps-sdk-swift-toolkit package, which provides the ArcGISToolkit framework as well as the ArcGIS framework.
18+
1. **Run** the `Samples` app target
19+
20+
> To add the Swift packages to your own projects, consult the documentation for the [ArcGIS Maps SDK for Swift Toolkit](https://github.com/Esri/arcgis-maps-sdk-swift-toolkit#swift-package-manager) and [ArcGIS Maps SDK for Swift](https://github.com/Esri/arcgis-maps-sdk-swift#instructions).
21+
22+
## Configuring API Keys
23+
24+
To run this app and access specific, ready-to-use services such as basemap layer, follow the steps to add an API key to a secrets file stored in the project file's directory, `$(SRCROOT)/.secrets`.
25+
26+
1. Create a hidden secrets file in the project file's directory.
27+
28+
```sh
29+
touch .secrets
30+
```
31+
32+
2. Add your **API Key** to the secrets file aforementioned. Adding an API key allows you to access a set of ready-to-use services, including basemaps. Acquire the keys from your [dashboard](https://developers.arcgis.com/dashboard). Visit the developer's website to learn more about [API keys](https://developers.arcgis.com/documentation/mapping-apis-and-services/security/api-keys/).
33+
34+
```sh
35+
echo ARCGIS_API_KEY_IOS=your-api-key >> .secrets
36+
```
37+
38+
> Replace 'your-api-key' with your keys.
39+
40+
Please see [Configure App Secrets](Documentation/ConfigureAppSecrets.md) for adding license key and other details.
41+
42+
## Additional Resources
43+
44+
* Unfamiliar with SwiftUI? Check out Apple's [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/).
45+
* Want to start a new project? [Setup](https://developers.arcgis.com/swift/get-started) your development environment
46+
* New to the API? Explore the documentation: [Guide](https://developers.arcgis.com/swift/) | [API Reference](https://developers.arcgis.com/swift/api-reference/documentation/arcgis/)
47+
* Got a question? Ask the community on our [forum](https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/bd-p/arcgis-runtime-sdk-for-ios-questions)
48+
49+
## Contributing
50+
51+
Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](https://github.com/esri/contributing).
52+
53+
Find a bug or want to request a new feature? Please let us know by [creating an issue](https://github.com/Esri/arcgis-maps-sdk-swift-samples/issues/new).
254

355
## Licensing
456

@@ -16,4 +68,4 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1668
See the License for the specific language governing permissions and
1769
limitations under the License.
1870

19-
A copy of the license is available in the repository's [LICENSE](https://github.com/Esri/arcgis-runtime-samples-swift/blob/main/LICENSE) file.
71+
A copy of the license is available in the repository's [LICENSE](LICENSE?raw=1) file.

Samples.entitlements

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.app-sandbox</key>
6+
<true/>
7+
<key>com.apple.security.network.client</key>
8+
<true/>
9+
<key>com.apple.security.personal-information.location</key>
10+
<true/>
11+
</dict>
12+
</plist>

0 commit comments

Comments
 (0)