I have an app using UrlSession
in Swift Playgrounds for iPad, and everything worked great.
I opened the same code in Swift Playgrounds for Mac, and the line:
let (data, _) = try await URLSession.shared.data(from: url)
silently fails everytime. I exported a small snippet to a playground in Mac, and found that adding:
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
At the beginning of the script fixes this in the playground. I am wondering if there is a way to move this code to the app version and get this up and running on the Mac? Or maybe this code was never designed to run on a Macbook?