Когда вы реализуете присутствующий ViewController типа Modal, в некоторых случаях вы увидите «Attempt to present which is already presenting».
До кода
uiView.window?.rootViewController?.present(viewController, animated: true)
Журнал ошибок
[Presentation] Attempt to present <UIViewController: 0x10c72d050> on <_TtGC7SwiftUI19UIHostingControllerGVS_15ModifiedContentVS_7AnyViewVS_12RootModifier__: 0x10c60ab30> (from <_TtGC7SwiftUI19UIHostingControllerGVS_15ModifiedContentVS_7AnyViewVS_12RootModifier__: 0x10c60ab30>) which is already presenting <UIViewController: 0x1201f72b0>.
После кода
guard let rootViewController =
uiView.window?.rootViewController else { return }
if rootViewController.presentedViewController == nil {
rootViewController.present(viewController, animated: true)
}