I had a similar problem / case where the action sheet didn't show up in the ViewController that was clicked on by another ViewController. The error she gave was also similar to yours. What you did works fine on regular ViewControllers, but just doesn't work on ViewControllers that drag and drop through another ViewController.
I solved the problem by setting the UIAlertController class object as an instance variable of my class, rather than storing it locally inside the launch function.
So try declaring var alertView: UIAlertController? at the top of the class where instance variables are declared, and then just initialize it in the desired launch function to use it like this:
static func presentAlert(_ message: String) { self.alertView = UIAlertController(title: "RxExample", message: message, preferredStyle: .alert) alertView.addAction(UIAlertAction(title: "OK", style: .cancel) { _ in }) rootViewController().present(alertView, animated: true, completion: nil) }
There may be some error on the part of Apple in maintaining the link that causes this problem. But the work I wrote about above works great.
source share