Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mochidev/urlsessionbackport
Backward compatible async/await for URLSession!
https://github.com/mochidev/urlsessionbackport
swift swift-5-5 swift-concurrency swift-package-manager urlsession
Last synced: about 2 months ago
JSON representation
Backward compatible async/await for URLSession!
- Host: GitHub
- URL: https://github.com/mochidev/urlsessionbackport
- Owner: mochidev
- License: mit
- Created: 2021-11-11T02:41:06.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-20T21:32:06.000Z (almost 2 years ago)
- Last Synced: 2024-03-26T01:56:01.909Z (10 months ago)
- Topics: swift, swift-5-5, swift-concurrency, swift-package-manager, urlsession
- Language: Swift
- Homepage:
- Size: 29.3 KB
- Stars: 36
- Watchers: 2
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# URLSessionBackport
`URLSessionBackport` aims to make it possible to use URLSession's new async/await syntax on older OSs, namely iOS 13 or macOS 10.15 and newer. Note that Xcode 13.2 is required, as that version contains the necessary back-ported async/await libraries.
## Installation
Add `URLSessionBackport` as a dependency in your `Package.swift` file to start using it. Then, add `import URLSessionBackport` to any file you wish to use the library in.
Please check the [releases](https://github.com/mochidev/URLSessionBackport/releases) for recommended versions.
```swift
dependencies: [
.package(url: "https://github.com/mochidev/URLSessionBackport.git", .upToNextMinor(from: "1.0.0")),
],
...
targets: [
.target(
name: "MyPackage",
dependencies: [
"URLSessionBackport",
]
)
]
```## What is `URLSessionBackport`?
`URLSessionBackport` adds a single property to your `URLSession` instances: `.backport`. The best part? Within this namespace, URLSession's async/await methods have been magically re-implemented, allowing you access to them on iOS 13 or macOS 10.15 and newer! Additionally, the methods are automatically marked as deprecated, so they'll let you know when it's safe to remove them.
## Contributing
Contribution is welcome! Please take a look at the issues already available, or start a new issue to discuss a new feature. Although guarantees can't be made regarding feature requests, PRs that fit with the goals of the project and that have been discussed before-hand are more than welcome!
Please make sure that all submissions have clean commit histories, are well documented, and thoroughly tested. **Please rebase your PR** before submission rather than merge in `main`. Linear histories are required.