Post

Replies

Boosts

Views

Activity

Reply to Cannot set constraints for an image view inside a scroll view
@Claude31 thanks for your response! My main problem is that XCode does not allow me to do the step in your "Create a UIView": "Define the constraints with respect to the scrollView (Superview)" . I.e. I am able to set constraints for the scroll view, but cannot set any constraints for the image view inside the scroll view. Please see attached screen shot of my current constraints list of the scroll view.
Feb ’22
Reply to AVPlayer video track freeze after 1 second while audio continues
I tried something different: instead of wrapping UIView using UIViewRepresentable, I changed to wrap AVPlayerViewController using UIViewControllerRepresentable, and then don't use my own video controls anymore. It seems like: If I share the same AVPlayer for each video item (i.e. each AVPlayerViewController), then I still have the video track freezing problem when scrolling between video items. If I create a new AVPlayer for each video item, then the video track freezing problem is gone. (I'm yet to find the best way to dismiss / stop AVPlayerViewController in wrapping swiftUI when it's scrolling off screen, any suggestions?)
Topic: Media Technologies SubTopic: Audio Tags:
May ’23
Reply to Cannot build Archive for a SwiftUI app that uses a XCFramework
I have found the root cause: I missed setting "Objective-C Bridging Header" for Release. The reason that the build worked for both the simulator and the device is that both of them are running the app in Debug mode, not in Release mode. But Archive requires building in Release mode. Now I've added the bridging header in the Build Setting for Release mode and the issue is gone.
Topic: App & System Services SubTopic: General Tags:
Jul ’23
Reply to Background URLSession http/3 URLSessionUploadTask not started in real device
Adding more info here as it's over the limit of a comment. I used WireShark to capture the packets from the real device. Looks like when the upload task is in a foreground URLSession, the session establishes http/3 QUIC connection without trying / waiting Http/1.1 first. This is expected as I am using assumesHTTP3Capable = true. But in a background URLSession, looks like the system tries to talk to Http/1.1 first, and as the server only talks http/3, the task fails to start. Is this behavior expected? If yes, why the difference between a foreground session and a background session?
Topic: App & System Services SubTopic: General Tags:
Aug ’23
Reply to How to find out network connection error details
At the API level? Or while debugging? Either would help. I am using URLSession (with QUIC only) and the app has multiple URLSession and many network requests. My goal is to figure out which request (or connection) is causing these messages. Right now I am going through the app code and making a bit progress, but still don't have a reliable way to debug such messages quickly. For debugging, the key thing in that log is this: [C1]. Is there a way for me to log this ID in my app log as well? How do I access this ID info given a URLSession ? You can then correlate that logging with the logging done by Network framework to work out which URLSession request is... I can log local IP / port / remote IP / port tuples, but how do I correlate to the message in this question? Maybe I missed something obvious?
Jun ’24
Reply to How to find out network connection error details
the ability to do that would be super useful and I encourage you to file an enhancement request for us to add it as a property to the task metrics API. Please post your bug number, just for the record. Thank you for your suggestion! I've opened a ticket: FB14017046 . And thanks a lot for your detailed example! It's helpful! (I finally realized that I should use Console app to view the system log). I can find the connection details now. One thing I didn't understand is: why is there "parent" and "child" connection / flow? Are they the "connection" and "stream" in the context of HTTP2/3 ? But even then, how can there be 3 levels of connection ID like C2.1.2?
Jun ’24