This repository provides async/await wrappers for ArcGIS Runtime SDK for iOS asynchronous methods using the Swift Concurrency capabilities introduced in Xcode 13 and Swift 5.5.
Xcode will automatically generate async/await wrappers for most asynchronous methods, but if the original method returns a value, then it must be wrapped explicitly to handle that return value. Many asynchronous methods in the ArcGIS Runtime SDK for iOS return an AGSCancelable
, and so are not automatically wrapped by Xcode. This repository provides those missing wrappers.
async
wrappers for ArcGIS Runtime SDK for iOS version 100.12 or later to complement those generated automatically by Xcode.If you find any methods that are missing an async wrapper, please open an issue (or better yet, submit a PR adding the method).
AsyncWrappers.swift
and AsyncWrapperActors.swift
source files in your project (see below).import ArcGISAsyncAwait
statement to your Swift source files.AGSJobs
, manually copy the AsyncCancelableJobWrapper.swift
file into your project. See Known Issues for more details.https://github.com/Esri/arcgis-runtime-ios-async-await
as the Package URL.Dependency Rule
to Up to Next Major Version and set the minimum version to 100.12.0
. Click Add Package.Note: The ArcGIS Runtime Async Await Swift Package adds the ArcGIS Runtime SDK package as a dependency.
New to Swift Package Manager? Visit swift.org/package-manager/.
AsyncWrappers.swift
and AsyncWrapperActors.swift
files into your project through the Xcode Project Navigator pane.AGSJob
subclass extensions, you must manually copy the AsyncCancelableJobWrappers.swift
file into your project. If the file were included as part of the Swift package, Xcode would generate conflicting non-canceling async wrappers.Find a bug or want to request a new feature? Please let us know by submitting an issue.
Please do not contact Esri Support with bugs in this repo's code.
Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.
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.
A copy of the license is available in the repository's LICENSE file.
link |
Stars: 5 |
Last commit: 2 years ago |
Includes fix for async methods that return no result, just an optional error (e.g. add()
, update()
, delete()
on AGSFeatureTable
).
Previously, a successful execution of the wrapped method would throw a nilOrNoResult
error.
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics