Hello @DTS Engineer,
Thank you for taking the time to evaluate this issue. I forgot to mention that the initial ViewController needs to be embedded in an UINavigationController in order to trigger the issue (otherwise the present method is never called).
We can update the code of the ViewController in the following way in order to remove this requirement and still trigger the issue:
class ViewController: UIViewController {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
let hostingController = UIHostingController(rootView: TestView())
let newNav = UINavigationController()
// This causes a freeze (iOS 18) or crash (iOS 17)
newNav.setViewControllers([hostingController], animated: true)
present(newNav, animated: true)
}
}
To simplify our further exchanges, I created a test project where you can reproduce the issue. You will find the project at this url.
Sorry for the inconvenience, let us know if you could reproduce it using our test project.
Thanks.
Topic:
UI Frameworks
SubTopic:
General
Tags: