Post

Replies

Boosts

Views

Activity

Reply to URLSession.upload does not return server response
Correct! This is a normal call to URLSession.upload(for:from:delegate) while the app is in the foreground, not a background session. The URLSession is created by us, but with the URLSessionConfiguration.default and only with a custom user agent string. Everything else is left as is. I might also add that the server is also our own software. The way it works is the server receives the data until the allowed maximum is reached, then it sends the response and closes the connection, while the network layer is still trying to send the remaining data. But again, I could see in the diagnostics log that the response is received and read.
Topic: App & System Services SubTopic: General Tags:
Jan ’23
Reply to URLSession.upload does not return server response
It is not. At least not to my knowledge, and I don't see the "Transfer-Encoding: chunked" header on the server side (I don't know if I would though, or if the framework we are using on the server (Spring Boot) handles that transparently). Would that be a possible solution? If so, how would I enable chunked transfer encoding? I tried to just add the Transfer-Encoding header to the URLRequest, but that didn't seem to do anything.
Topic: App & System Services SubTopic: General Tags:
Feb ’23
Reply to URLSession.upload does not return server response
Interesting, I did not know this header. It seems to do exactly what you would want: give the server a chance to reject the request before the upload of the body is even started. I added the header to the URLRequest, but that did not fix the problem. But that might very well be a problem on the server side. I'm still investigating that. So I guess that would be our best shot? Trying to make our server support this header?
Topic: App & System Services SubTopic: General Tags:
Feb ’23
Reply to How to import large data from Server and save it to Swift Data
One way would be to perform the import in the background in a @ModelActor. Something like this: @ModelActor actor ImportService { func import(data: [Data]) throws { for date in data { let model = Model(/* ... */) modelContext.insert(model) } try modelContext.save() } } This way the import will not block the UI, and the imported data will only be visible in the UI after modelContext.save() is called. I haven't used SwiftData in a real-world app yet, however, so do be careful. For example I don't know if SwiftData will keep the models in memory until save() is called, so you might have to save more frequently. But even then, the UI will not update for every newly inserted model but only when you choose.
Apr ’25
Reply to Xcode 16.4 iOS 18.5 simulator crashes for Apps requiring webkit
For me the option 2 is not working (and option 1 is not really an option as we need to support older iOS versions). I followed the instructions, added the DYLD_FALLBACK_LIBRARY_PATH argument to the Run configuration of my scheme like this: DYLD_FALLBACK_LIBRARY_PATH=/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.5.simruntime/Contents/Resources/RuntimeRoot/System/Cryptexes/OS/usr/lib/swift But the app still crashed, and when it logs the dyld config, it prints this: DYLD_FALLBACK_LIBRARY_PATH=/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/ So it seems my value for DYLD_FALLBACK_LIBRARY_PATH is just ignored. I checked it a thousand times and don't understand what I'm doing wrong. Is this working for other people too? Edit Found the solution, see comments if you run into the same problem.
Jun ’25
Reply to Crash in URLSessionConfiguration init in Xcode 26.0 beta (17A5241e)
Thank you for posting this here! Our app is affected as well and I have been trying to produce a minimal example in a new project all afternoon but failed, just like you said. To add some information: I can crash our app by simply accessing URLSession.shared or URLSessionConfiguration.default (but not by simply accessing URLSessionConfiguration.ephemeral) in the initializer of our AppDelegate.
Jun ’25
Reply to Could not find library with name ”/usr/lib/swift/libswiftWebKit.dylib“
This seems to be related to this problem for iOS Simulators: Xcode 16.4 iOS 18.5 simulator crashes for Apps requiring webkit The crash only occurs when some specific methods are called on WKWebView and some other types. One workaround for iOS simulator was providing a path for libswiftWebKit.dylib via DYLD_FALLBACK_LIBRARY_PATH. I don't know how this would be done in Previews though.
Jun ’25
Reply to Can't upload to AppStore - Invalid Provisioning Signature
As suggested by https://twitter.com/hunter/status/1513960632059510784 I just deleted my local provisioning profile files which forced Xcode to generate them again and this fixed the issue for me.
Replies
Boosts
Views
Activity
Apr ’22
Reply to URLSession.upload does not return server response
Correct! This is a normal call to URLSession.upload(for:from:delegate) while the app is in the foreground, not a background session. The URLSession is created by us, but with the URLSessionConfiguration.default and only with a custom user agent string. Everything else is left as is. I might also add that the server is also our own software. The way it works is the server receives the data until the allowed maximum is reached, then it sends the response and closes the connection, while the network layer is still trying to send the remaining data. But again, I could see in the diagnostics log that the response is received and read.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to URLSession.upload does not return server response
Yes!
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to URLSession.upload does not return server response
It is not. At least not to my knowledge, and I don't see the "Transfer-Encoding: chunked" header on the server side (I don't know if I would though, or if the framework we are using on the server (Spring Boot) handles that transparently). Would that be a possible solution? If so, how would I enable chunked transfer encoding? I tried to just add the Transfer-Encoding header to the URLRequest, but that didn't seem to do anything.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to URLSession.upload does not return server response
Interesting, I did not know this header. It seems to do exactly what you would want: give the server a chance to reject the request before the upload of the body is even started. I added the header to the URLRequest, but that did not fix the problem. But that might very well be a problem on the server side. I'm still investigating that. So I guess that would be our best shot? Trying to make our server support this header?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to React to pinned state of a CollectionView header
Ok, found the answer: the header view class can also be a UICollectionViewListCell, which provides the exact same mechanism as UITableViewHeaderFooterView.
Topic: UI Frameworks SubTopic: UIKit
Replies
Boosts
Views
Activity
Aug ’24
Reply to Programmatically setting accessibility focus broken?
Thank you for the quick answers! To be on the safe side I had a co-worker test this on his iPhone, and there it worked. So I rebooted mine and tried again, and now it works on mine as well. So false alarm I guess.
Replies
Boosts
Views
Activity
Jan ’25
Reply to How to import large data from Server and save it to Swift Data
One way would be to perform the import in the background in a @ModelActor. Something like this: @ModelActor actor ImportService { func import(data: [Data]) throws { for date in data { let model = Model(/* ... */) modelContext.insert(model) } try modelContext.save() } } This way the import will not block the UI, and the imported data will only be visible in the UI after modelContext.save() is called. I haven't used SwiftData in a real-world app yet, however, so do be careful. For example I don't know if SwiftData will keep the models in memory until save() is called, so you might have to save more frequently. But even then, the UI will not update for every newly inserted model but only when you choose.
Replies
Boosts
Views
Activity
Apr ’25
Reply to Xcode 16.4 iOS 18.5 simulator crashes for Apps requiring webkit
For me the option 2 is not working (and option 1 is not really an option as we need to support older iOS versions). I followed the instructions, added the DYLD_FALLBACK_LIBRARY_PATH argument to the Run configuration of my scheme like this: DYLD_FALLBACK_LIBRARY_PATH=/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.5.simruntime/Contents/Resources/RuntimeRoot/System/Cryptexes/OS/usr/lib/swift But the app still crashed, and when it logs the dyld config, it prints this: DYLD_FALLBACK_LIBRARY_PATH=/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/ So it seems my value for DYLD_FALLBACK_LIBRARY_PATH is just ignored. I checked it a thousand times and don't understand what I'm doing wrong. Is this working for other people too? Edit Found the solution, see comments if you run into the same problem.
Replies
Boosts
Views
Activity
Jun ’25
Reply to Crash in URLSessionConfiguration init in Xcode 26.0 beta (17A5241e)
Thank you for posting this here! Our app is affected as well and I have been trying to produce a minimal example in a new project all afternoon but failed, just like you said. To add some information: I can crash our app by simply accessing URLSession.shared or URLSessionConfiguration.default (but not by simply accessing URLSessionConfiguration.ephemeral) in the initializer of our AppDelegate.
Replies
Boosts
Views
Activity
Jun ’25
Reply to urlSession(_:dataTask:didReceive:) not called when using completion handler-based dataTask(w
As I understand the documentation, this is indeed the expected behavior: By using the completion handler, the task bypasses calls to delegate methods for response and data delivery, and instead provides any resulting NSData, URLResponse, and NSError objects inside the completion handler. See dataTask(with:completionHandler:)
Replies
Boosts
Views
Activity
Jun ’25
Reply to Could not find library with name ”/usr/lib/swift/libswiftWebKit.dylib“
This seems to be related to this problem for iOS Simulators: Xcode 16.4 iOS 18.5 simulator crashes for Apps requiring webkit The crash only occurs when some specific methods are called on WKWebView and some other types. One workaround for iOS simulator was providing a path for libswiftWebKit.dylib via DYLD_FALLBACK_LIBRARY_PATH. I don't know how this would be done in Previews though.
Replies
Boosts
Views
Activity
Jun ’25
Reply to Crash in URLSessionConfiguration init in Xcode 26.0 beta (17A5241e)
Still crashes for us.
Replies
Boosts
Views
Activity
Jun ’25
Reply to What's the trick for copying a file to a simulator session?
All I can say is that Drag & Drop works for me. Depending on the file type, it opens the Photos or Files app, respectively. It does sound like there is something wrong with your installation.
Replies
Boosts
Views
Activity
Jun ’25
Reply to The async/await API crashes in Xcode 16.3 and later
Interesting. We use UIApplication.shared.setAlternateIconName() in the same way as you describe: the async/await version in a @MainActor annotated method. And we have no problem, neither in Xcode 16.3 nor 16.4. Both simulator and physical device.
Replies
Boosts
Views
Activity
Jun ’25