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.
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.
let session = URLSession.shared // ↑ or ↓ let session = URLSession(configuration: configuration) let response: (Data, URLResponse) = try await session.data(from: url)