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
Reply to does iPhone support Wi-Fi TDLS?
Sorry about my late response. I am trying to use iPhone to communicate with other devices in the same WiFi LAN, and wondering if can use TDLS to reduce the load on the WiFi router. If not TDLS, is there any other thing I can use for iPhone to achieve the goal? Thanks.
Replies
Boosts
Views
Activity
Dec ’21
Reply to Cannot set constraints for an image view inside a scroll view
To clarify 2 things, (1) I was able to set constraints between the scroll view and its superview, i.e. the Content View of the cell. (2) Xcode was not able to fix the "missing constraints" automatically, I tried that.
Replies
Boosts
Views
Activity
Feb ’22
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.
Replies
Boosts
Views
Activity
Feb ’22
Reply to Cannot set constraints for an image view inside a scroll view
Can I ask what version of XCode are you using? I'm thinking whether it's a bug in XCode. (I am using XCode 12.5.1 on macOS Big Sur, and using Objective-C).
Replies
Boosts
Views
Activity
Feb ’22
Reply to Cannot set constraints for an image view inside a scroll view
Here is the screen shot that shows Xcode disables the constraints setting for the image view inside the scroll view:
Replies
Boosts
Views
Activity
Feb ’22
Reply to embedded AVPlayerViewController reads video partially but did not play
Never mind, I changed to a different approach to use AVPlayerLayer instead, and now it works.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’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:
Replies
Boosts
Views
Activity
May ’23
Reply to AVPlayer video track freeze after 1 second while audio continues
Finally I created a new AVPlayer for each item, i.e. no longer replacing an old item with a new item in the same AVPlayer and the issue is gone.
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
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:
Replies
Boosts
Views
Activity
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:
Replies
Boosts
Views
Activity
Aug ’23
Reply to TLS For Accessory Developers: does it work for non-local network?
Another question I have is: based on NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway? , can I opt to connect to the server anyway programmatically?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to Unable to tap SwiftUI menu with XCUITest (ios15)
Instead of using buttons, use images: app.images["cardMenu"].tap()
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to How to make content view extend beneath NavigationBar like in a ZStack?
I tried to use .edgesIgnoringSafeArea([.top]) modifier, but MyView still shift when NavigationBar hides, just shifting a different amount.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’24
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?
Replies
Boosts
Views
Activity
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?
Replies
Boosts
Views
Activity
Jun ’24