swift – URLSession – ‘data(from:)’ was deprecated in iOS 15.0


We can infer that you must be using an extension similar to Making async system APIs backward compatible:


@available(iOS, deprecated: 15.0, message: "Use the built-in API instead")
extension URLSession {
    func data(from url: URL) async throws -> (Data, URLResponse) {
        …
    }
}

That was intended to provide backward support for a function introduced in iOS 15, but you apparently no longer need support iOS 13 or 14, so this extension is redundant.

You can control-click on the line of code producing this warning and choose “Jump to source” and you should be taken to the offending implementation.

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img