Posts

Post not yet marked as solved
8 Replies
1.3k Views
Hello, I have a problem with uploading data via URLSession when the server responds with an error. Specifically, I upload data with URLSession.upload(for:from:delegate). The server determines that the data is too large and responds with http status 413 (Payload Too Large). However, that response is not returned by URLSession.upload. Instead, it waits until a timeout occurs and throws that as an error. The weird part is: in the simulator it works perfectly fine and the server response is returned immediately as one would expect. But on an actual device (iPhone, iOS 16.3), it always runs into the timeout. I tested this with the same data. In Xcode's console, I see an interesting message: "Connection 1: received failure notification". I do not see that message in the console when running the app in the simulator. (I tried to include more log messages but the forum software wouldn't let me). I also tried to activate network debugging via CFNETWORK_DIAGNOSTICS, but could not make much sense of it. But I do see that the server response is received almost immediately. So the response is received by the network layer, just not returned by URLSession. By the way, calling upload(for:fromFile:delegate) behaves the same way. As does using a completion handler instead of async/await. I'm at a loss because I don't think our code is wrong. And I'm completely puzzled by the fact that it works as expected in the simulator.
Posted
by HolgerDe.
Last updated
.
Post marked as solved
7 Replies
1.8k Views
In our app we have a TableViewController that is vertically flipped by setting tableView.transform = CGAffineTransform(scaleX: 1, y: -1) (and the same is applied to all cells). We noticed in iOS 14, initially the layout respects the safe area as expected, but after rotating the device it does not update properly, but the same safe area insets as before are applied. So for example when opening the view in portrait and then rotating to landscape, the insets left and right are still 0 and the content is rendered outside the safe area. When looking at tableView.safeAreaInsets, you can see the values are not updated after rotating, and viewSafeAreaInsetsDidChange() does not get called. The bug can be reproduced with any transformation. This worked perfectly fine in iOS 13. Is this a bug in UIKit? Is there a workaround?
Posted
by HolgerDe.
Last updated
.