Description
I have SwiftMessageSegue called form the same view controller and configured literally by same code.
In one case the startReleaseMonitor() continues restarting itself each 2 seconds until user dismisses the dialog (expected behavior), but in another case it ends up in self.source.view.window
being .none
and hides everything (unexpectedly).
Adding segue.duration = .forever
doesn't help.
The only meaningful difference in code is that the segue works properly in a scenario when it is called as a result of a button tap:
@IBAction func updateRequestButtonTapped(_ sender: Any) {
performSegue(withIdentifier: "openConfirmation", sender: self)
}
While the malfunctioning scenario is when it is called from a function, which in its turn is triggered from a delegate method.
private func createFRP() {
performSegue(withIdentifier: "openConfirmation", sender: self)
}
extension NewFlightRequestViewController: SetRequestPreferencesDelegate {
func createFlightRequest(with preferences: RequestPreferences?) {
self.viewModel.setRequestPreferences(prefs: preferences)
self.createFRP()
}
}
I suppose it might be related to view hierarchy, because in the successful scenario it is opened modally above another modal dialog while in unsuccessful one it is opened modally above a simple view controller (having a usual navigation bar).
Important to note that it worked correctly since 2021. After rolling a few versions back I have figured out it was working fine in 9.0.6 and the issue appeared in 9.0.7.