App hangs when presenting modal view controller with large data set in iOS 17
I'm working on a project and hit a roadblock... This might be a silly question, but I'm working with a important performance scenario when trying to present a modal view controller that displays data from an API. Specifically, when I fetch a large dataset (about 500 records) and try to present it in a `UITableView`, the app freezes for about 5-10 seconds before the modal appears. This happens only on devices running iOS 17, while it works smoothly on iOS 16 and earlier versions. I've tried dispatching the data fetching to a background queue: ```swift DispatchQueue.global(qos: .background).async { self.fetchData() DispatchQueue.main.async { self.present(modalViewController, animated: true) } } ``` However, this did not resolve the scenario. I also attempted to optimize the `UITableView` by implementing lazy loading for images and batching the data loading, but I still experience the same freezing behavior. In addition, I verified that the UI is not blocked during data fetching, as I can see other UI elements responding. However, the modal transition itself seems to be the culprit. I get the following warning in the console just before the hang: `[App] Warning: Attempt to present <ModalViewController: 0x1234567890> on <ViewController: 0x0987654321> whose view is not in the window hierarchy!` Has anyone encountered a similar scenario with modal presentations in iOS 17 or have suggestions on optimizing the way I'm presenting the modal while handling large datasets? Any tips or best practices would be greatly appreciated! This is part of a larger API I'm building. How would you solve this?