Skip to content

Commit

Permalink
Merge pull request #97 from Esri/v.next
Browse files Browse the repository at this point in the history
[Release] 200.0.0-beta
  • Loading branch information
yo1995 committed Dec 13, 2022
2 parents 155f56d + 2bcd753 commit 5992329
Show file tree
Hide file tree
Showing 188 changed files with 11,187 additions and 13 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# The name of the job, which will be displayed for the status check in PR.
name: README and metadata formatting

# Controls when the action will run.
# Below triggers the workflow on pull requests to `main` or `v.next` branch.
on:
pull_request:
branches:
- main
- v.next

# A workflow run is made up of one or more jobs that can run sequentially or
# in parallel.
jobs:
# This workflow contains a single job called "changes"
changes:
name: Check README and metadata format for changed files

# Comment out the line below if the job is only running for certain labels.
# i.e. only run the job on PRs with label "new-sample"

# if: contains(github.event.pull_request.labels.*.name, 'new-sample')

# The type of runner that the job will run on
# 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
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that got executed as part of the job.
steps:

# This step gets the paths to all changed files and returns an array
# such as ['xxx/README.md', 'xxx/README.metadata.json', 'xxx/1.png']
# https://github.com/trilom/file-changes-action
- id: file_changes
name: Detect changed file paths
uses: trilom/file-changes-action@master

# Checks-out your repository under $GITHUB_WORKSPACE, so the workflow can
# access the files.
# https://github.com/actions/checkout
- name: Checkout the repository
uses: actions/checkout@v2

# Print out changed file paths for debugging purposes.
- name: Print changed file paths
run: |
echo 'Below shows a list of changed file paths'
echo '${{ steps.file_changes.outputs.files}}'
# echo '${{ steps.file_changes.outputs.files_modified}}'
# echo '${{ steps.file_changes.outputs.files_added}}'
# echo '${{ steps.file_changes.outputs.files_removed}}'

- name: Run CI (currently only style checks)
uses: ./Scripts/CI
with:
FILE_PATHS: ${{ steps.file_changes.outputs.files }}

# Runs a single command using the runners shell
# - name: Run a script with Python
# run: python ./Scripts/README-formatter.py
13 changes: 6 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# App Secrets
#
## App Secrets
.secrets

# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData/
Expand All @@ -30,10 +25,14 @@ xcuserdata/
*.xcscmblueprint

## Portal Item Data
/Portal\ Data
Portal\ Data/

## Swift Package Manager
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
Packages/
Package.pins
Package.resolved

## Python build artifact
# If the style check scripts are run locally, ignore the script build artifact.
Scripts/CI/__pycache__/
86 changes: 86 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
custom_rules:
spatial_reference_web_mercator:
name: Web Mercator Spatial Reference
regex: SpatialReference\(wkid:\s*(3857|102100)\)
message: "Use 'SpatialReference.webMercator' instead."
spatial_reference_wgs84:
name: WGS84 Spatial Reference
regex: SpatialReference\(wkid:\s*(4326)\)
message: "Use 'SpatialReference.wgs84' instead."
simple_closure:
name: Simple Closure
regex: (-> Void in)|(\(\) in)
message: "Void return and empty arguments should be avoided in closures."
closure_opening_space:
name: Closure Opening Space
regex: \{\[|\{\s{2,}\[
message: "Use one space between the brace and bracket."

# Rule identifiers to exclude from running
disabled_rules:
- file_length
- for_where
- force_cast
- line_length
- notification_center_detachment
- type_body_length
- type_name

# Some rules are only opt-in
opt_in_rules:
- anyobject_protocol
- array_init
- attributes
- closure_end_indentation
- closure_spacing
- collection_alignment
- contains_over_first_not_nil
- convenience_type
- discouraged_direct_init
- discouraged_optional_boolean
- empty_count
- empty_string
- empty_xctest_method
- explicit_init
- extension_access_modifier
- fatal_error_message
- first_where
- function_default_parameter_at_end
- identical_operands
- joined_default_parameter
- legacy_random
- let_var_whitespace
- literal_expression_end_indentation
- lower_acl_than_parent
- missing_docs
- modifier_order
- multiline_arguments
- multiline_function_chains
- multiline_parameters
- operator_usage_whitespace
- operator_whitespace
- overridden_super_call
- override_in_extension
- prohibited_super_call
- redundant_nil_coalescing
- redundant_type_annotation
- sorted_first_last
- static_operator
- toggle_bool
- trailing_closure
- untyped_error_in_catch
- vertical_parameter_alignment_on_call
- vertical_whitespace_closing_braces
- vertical_whitespace_opening_braces
- yoda_condition

identifier_name:
min_length:
# Do not flag short identifiers
warning: 0
trailing_closure:
only_single_muted_parameter: true
trailing_whitespace:
ignores_empty_lines: true
multiline_arguments:
only_enforce_after_first_closure_on_first_line: true
27 changes: 27 additions & 0 deletions Documentation/ConfigureAppSecrets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Configure App Secrets

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.

This build rule looks for a secrets file stored in the project's root directory, `$(SRCROOT)/.secrets`.

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.

1. Create a hidden secrets file in the project's root directory.

```sh
touch .secrets
```

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

```sh
echo ARCGIS_LICENSE_KEY=your-license-key >> .secrets
echo ARCGIS_EXTENSION_LICENSE_KEY=your-extension-license-key >> .secrets
echo ARCGIS_API_KEY_IOS=your-api-key >> .secrets
```

> Replace 'your-license-key', 'your-extension-license-key' and 'your-api-key' with your keys.
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/).

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.
9 changes: 5 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Apache License

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

Expand Down Expand Up @@ -178,15 +179,15 @@ Apache License
APPENDIX: How to apply the Apache License to your work.

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

Copyright 2014 Esri
Copyright 2022 Esri

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -198,4 +199,4 @@ Apache License
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.
limitations under the License.
56 changes: 54 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,56 @@
# ArcGIS Runtime SDK for Swift Samples
# ArcGIS Maps SDK for Swift Samples

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.

## Requirements

* [ArcGIS Maps SDK for Swift](https://developers.arcgis.com/swift/) 200.0 (or newer)
* [ArcGIS Maps SDK for Swift Toolkit](https://github.com/Esri/arcgis-maps-sdk-swift-toolkit) 200.0 (or newer)
* Xcode 14.0 (or newer)

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.

## Building Samples Using Swift Package Manager

1. **Fork** and then **clone** the repository
1. **Open** the `Samples.xcodeproj` **project** file
> 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.
1. **Run** the `Samples` app target

> 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).
## Configuring API Keys

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

1. Create a hidden secrets file in the project file's directory.

```sh
touch .secrets
```

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/).

```sh
echo ARCGIS_API_KEY_IOS=your-api-key >> .secrets
```

> Replace 'your-api-key' with your keys.
Please see [Configure App Secrets](Documentation/ConfigureAppSecrets.md) for adding license key and other details.

## Additional Resources

* Unfamiliar with SwiftUI? Check out Apple's [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/).
* Want to start a new project? [Setup](https://developers.arcgis.com/swift/get-started) your development environment
* New to the API? Explore the documentation: [Guide](https://developers.arcgis.com/swift/) | [API Reference](https://developers.arcgis.com/swift/api-reference/documentation/arcgis/)
* 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)

## Contributing

Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](https://github.com/esri/contributing).

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

## Licensing

Expand All @@ -16,4 +68,4 @@ 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.

A copy of the license is available in the repository's [LICENSE](https://github.com/Esri/arcgis-runtime-samples-swift/blob/main/LICENSE) file.
A copy of the license is available in the repository's [LICENSE](LICENSE?raw=1) file.
12 changes: 12 additions & 0 deletions Samples.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.personal-information.location</key>
<true/>
</dict>
</plist>

0 comments on commit 5992329

Please sign in to comment.