URLSession bug in Xcode 16.3? Here’s a reliable workaround.

If a URLSession is created as shown below and the code is running on the simulator, the network connection may be lost or the request may time out.
let session = URLSession.shared
This issue will affect all URLSession clients only in simulator. Here is workaround for this:
let session: URLSession = {
return URLSession(configuration: .ephemeral)
}()
Happy Coding 🙂