Как из функции при нажатии кнопки Ok вызвать открытие ContentView?
Есть такая функция:
func didFinishConfirmation(paymentMethodType: YooKassaPayments.PaymentMethodType) {
DispatchQueue.main.async { [weak self] in
guard let self = self else { return }
let alertController = UIAlertController(
title: "Confirmation",
message: "успешно",
preferredStyle: .alert
)
let action = UIAlertAction(title: "OK", style: .default)
alertController.addAction(action)
self.dismiss(animated: true)
self.present(alertController, animated: true)
}
}
Как сделать так, чтобы при нажатии на кнопку Ok при появлении предупреждения открывался ContentView() в SwiftUI?
Источник: Stack Overflow на русском