Working on API, which uses Combine instead of closures. Fetching a resource with a closure using URLSession task and .resume
gives no errors, while fetching with Combine gives:
Connection 57: unable to determine fallback status without a connection
struct Item: View {
@ObservedObject var item: Item
@State var thumbnail: UIImage?
var body: some View {
NavigationLink(destination: ItemView(item: item, thumbnail: thumbnail)) {
ItemRowView(item: item, thumbnail: thumbnail)
}
.onAppear {
let url = URL(string: "valid address")!
let cancellable = URLSession.shared.dataTaskPublisher(for: url)
.receive(on: DispatchQueue.main)
.sink(receiveCompletion: { print ("Received completion: \($0).") },
receiveValue: { print ("Received data: \($0.data).")})
}
}
}
There's a similar question at Unable to determine interface type without an established connection Xcode. However, there shouldn't be any TLS errors in my case as the endpoint has a valid certificate and works okay without Combine.
Could you please interpret the error itself as it's not clear what fallback status is missing and why there's no connection?