cronet-xcframework is xcframework wrapper for Cronet.
Supports installation via Swift Package Manager.
Cronet is the networking stack of Chromium put into a library for use on mobile.
This is the same networking stack that is used in the Chrome browser by over a billion people.
It offers an easy-to-use, high performance, standards-compliant, and secure way to perform HTTP requests.
https://chromium.googlesource.com/chromium/src/+/master/components/cronet
Warning
Cronet does not support bitcode.
Add cronet-xcframework to a Package.swift manifest.
let package = Package(
// ...
dependencies: [
.package(url: "https://github.com/fuziki/cronet-xcframework", exact: "104.0.5112-8"),
],
targets: [
.target(
name: "MyLibrary",
dependencies: [
.product(name: "Cronet", package: "cronet-xcframework")
]),
]
)
Cronet.setQuicEnabled(true)
Cronet.start()
Cronet.registerHttpProtocolHandler() // setup for URLSession.shared
// ↑ or ↓
let configuration = URLSessionConfiguration.default
Cronet.install(into: configuration)
See Cronet.h↓ for more opsions.
https://chromium.googlesource.com/chromium/src/+/master/components/cronet/ios/Cronet.h
let session = URLSession.shared
// ↑ or ↓
let session = URLSession(configuration: configuration)
let response: (Data, URLResponse) = try await session.data(from: url)
link |
Stars: 2 |
Last commit: 1 year ago |
current_version: 104.0.5112.99, channel: stable
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics