First render of UIHostingConfiguration causes app hang

Originator:andreaantonioni97
Number:rdar://FB13463653 Date Originated:
Status:Open Resolved:
Product:SwiftUI Product Version:
Classification: Reproducible:
 
We experienced an app hang while scrolling in a UITableView when we display a cell featuring a UIHostingConfiguration for the first time. To reporoduce the issue, we created a sample app that contains a UITableView with 20 UITableViewCells and a single UITableViewCell where we assign a UIHostingConfiguration (with a simple SwiftUI view) as the contentConfiguration. Even in the very small and trivial sample app, we see a huge app hang when we scroll in the SwiftUI view for the first time. Scrolling in / out the view after that does not cause additional app hangs. Note: When we run the app on a physical device using xcode, we see the hang. When killing the app and immediately restarting it, we don't see the hang happening again. I've attached the Xcode project of our sample app as well as a demo recording to this ticket. It would be very interesting to understand if that's an issue related to Xcode (e.g. slow fetching of SwiftUI packages), if it's limited to debug builds or if it's on our side and we messed up the implementation of UIHostingConfiguration. Thanks in advance!

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!